in reply to Find new files in tree

There's not much more you can do from here, apart from the fact that you could be statting the file twice. You should be using
-f $_ and -M _ < $age

but this will only give marginal improvements. If you install Perl on the distant server and run the script from there (i.e., locally, so as to exclude the network traffic cost from the script), does it run any faster?

Unless you've modified the default registry settings, NT will reflect a change in a file timestamp in the directory timestamp as well. You may be able to use this as a test to see whether you have to stat all the files in the directory to see which file changed.

On the other hand, I can't remember whether under NT it is possible to count the number of links to the current directory to determine whether there are any children directories (and thus, whether you have to traverse it or not to continue descending the tree).

perl -le 'print( (stat $_)[3] ) for @ARGV' . .. /tmp

And tr/'/"/ for Win32

Damn, I just tested and it doesn't work. On Unix, if the number of links to '.' is 2, then you know it is referred to only by itself and its parent. If the numbe is higher, then a subdirectory must be referring to it as a parent. Unfortunately, on Windows 95 and Windows NT, nlink always returns 1.


print@_{sort keys %_},$/if%_=split//,'= & *a?b:e\f/h^h!j+n,o@o;r$s-t%t#u'