Re: finding newest file in a folder
Re: finding newest file in a folder
- Subject: Re: finding newest file in a folder
- From: Christopher Nebel <email@hidden>
- Date: Mon, 15 Mar 2004 17:04:48 -0800
On Mar 15, 2004, at 4:10 PM, steve harley wrote:
on 14 Mar 2004, at 2:04 PM, Christopher Nebel wrote:
set k to paragraph 1 of (do shell script "ls -Ft " & quoted form of
d & " | grep -v '/$')
-F adds "/" to directories, but also adds characters to names of
executables, symlinks, etc.. -p is cleaner.. and why not just let the
shell finish it off:
set k to do shell script "ls -pt " & quoted form of d & " | grep -v /$
| head -1"
Both good points -- I run with -F all the time, so that's the first
thing that came to mind. Piping through head(1) had occurred to me,
but I suppressed the idea because I don't like the way "do shell
script" mangles line endings for you.
--Chris Nebel
AppleScript Engineering
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.