• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Shell script help - get date of last modified file in hierarchy
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

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>)

  • Prev by Date: Re: Shell script help - get date of last modified file in hierarchy
  • Next by Date: Re: Shell script help - get date of last modified file in hierarchy
  • Previous by thread: Re: Shell script help - get date of last modified file in hierarchy
  • Next by thread: Re: Shell script help - get date of last modified file in hierarchy
  • Index(es):
    • Date
    • Thread