• 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: Message -ID, email@hidden, Back and forth between Posix and HFS paths
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Message -ID, email@hidden, Back and forth between Posix and HFS paths


  • Subject: Re: Message -ID, email@hidden, Back and forth between Posix and HFS paths
  • From: "Mark J. Reed" <email@hidden>
  • Date: Mon, 29 Mar 2010 19:58:11 -0400

Something added some spurious "\n"s to the perl code.  It should just be this:

do shell script "perl -MFile::Find -le 'find(sub { return if -d || $_
eq \".DS_Store\"; $mtime = (lstat $_)[9]; $newest =
[$File::Find::name, $mtime] if (!$newest || $mtime > $newest->[1]); },
shift);  print $newest->[0]'  " & (quoted form of POSIX path of
myFolder)


which will return the POSIX path of the newest non-folder,
non-.DS_Store file under myFolder.





On Mon, Mar 29, 2010 at 7:39 PM, Cosgrave Valentine <email@hidden> wrote:
> Mark's last seems to have done the job.
> do shell script "perl -MFile::Find -le 'find(sub { return if -d || $_\neq
> \".DS_Store\"; $mtime = (lstat $_)[9]; $newest =\n[$File::Find::name,
> $mtime] if !$newest || $mtime > $newest->[1]; },\nshift);  print
> $newest->[0]' " & (quoted form of POSIX path of myFolder)
> Thrilled.
> Much appreciated.
> Val
>
>
> I had been preparing this email to spur a different approach
> I came across a script in my search of the various threads.
>
> set theList to (do shell script "/usr/bin/find " & quoted form of POSIX path
> of theFolder & " -type f ! -name '\\.*' -print0 | /usr/bin/xargs -0
> /usr/bin/basename | /usr/bin/sort -df")
> This returns the names of all the files (no folders) in the directory in
> paragraph format and in alphabetical order.  and is very fast.
> Might there be a way to sort these in date modified  order ?
>  Please be aware that my level of scripting could be described as high level
> plagiarism.
> Val
>
>



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

  • Follow-Ups:
    • Re: Message -ID, email@hidden, Back and forth between Posix and HFS paths
      • From: Cosgrave Valentine <email@hidden>
References: 
 >Message -ID, email@hidden, Back and forth between Posix and HFS paths (From: Cosgrave Valentine <email@hidden>)
 >Re: Message -ID, email@hidden, Back and forth between Posix and HFS paths (From: Alex Zavatone <email@hidden>)
 >Re: Message -ID, email@hidden, Back and forth between Posix and HFS paths (From: "Mark J. Reed" <email@hidden>)
 >Re: Message -ID, email@hidden, Back and forth between Posix and HFS paths (From: Cosgrave Valentine <email@hidden>)

  • Prev by Date: Re: Message -ID, email@hidden, Back and forth between Posix and HFS paths
  • Next by Date: Re: Message -ID, email@hidden, Back and forth between Posix and HFS paths
  • Previous by thread: Re: Message -ID, email@hidden, Back and forth between Posix and HFS paths
  • Next by thread: Re: Message -ID, email@hidden, Back and forth between Posix and HFS paths
  • Index(es):
    • Date
    • Thread