Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Shell script help - get date of last modified file in hierarchy



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:
http://lists.apple.com/mailman/options/applescript-users/email@hidden
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Re: Shell script help - get date of last modified file in hierarchy (From: "Mark J. Reed" <email@hidden>)
 >Re: Shell script help - get date of last modified file in hierarchy (From: Mark Walsh <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.