Re: Shell script help - get date of last modified file in hierarchy
Re: Shell script help - get date of last modified file in hierarchy
- Subject: Re: Shell script help - get date of last modified file in hierarchy
- From: "Mark J. Reed" <email@hidden>
- Date: Tue, 27 Mar 2007 20:41:15 -0400
On 3/27/07, Mark Walsh <email@hidden> wrote:
> do shell script "perl -MFile::Find -MFile::stat -le 'my $latest_mtime
> = 0; find ( sub { my $mtime = stat($_)->mtime; $latest_mtime = $mtime
> if $mtime > $latest_mtime; }, @ARGV); print $latest_mtime;' " &
> quoted form of POSIX path of startFolder
I'd also try getting rid of the -MFile::stat and replacing the
«stat($_)->mtime» with «(stat)[9]» may speed things up even more.
Once upon a time those object/method wrappers were lots of overhead; I
understand the situation is improved, but for something you're calling
for every file in a directory subtree, the savings may be significant.
I'll check that, but I'm a little wary of using the 'entire contents', for
speed issues.
Yup. Good to know there's an easy pure-AS solution, though.
When I get a chance, I'll try all of the suggestions on one of the larger
job folders I have and see how well they work for me.
Please share your results. Should be interesting.
--
Mark J. Reed <email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden