Re: last opened
Re: last opened
- Subject: Re: last opened
- From: "Mark J. Reed" <email@hidden>
- Date: Thu, 22 Mar 2007 18:20:35 -0400
On 3/22/07, Vince Angeloni <email@hidden> wrote:
You can also use 'do shell' using Ruby to get the date and time a file was
last accessed.
Didn't I say that? :) I gave a Perl example, but noted that Python,
Ruby, and Tcl would also work.
The Ruby is a little pithier since it doesn't require the -Mmodule
stuff - in Perl, you could use (stat(file))[8] instead of
stat(file)->atime, and thereby lose the -MFile::stat, but the result
is less legible.
What?
Yes, I used the word "legible" while talking about Perl. Stop snickering!
Philistines.
Other options (where /filename/ means /" & quoted form of POSIX path
to fileObj & "/):
do shell script "python -c \"import os; print
os.stat(filename).st_atime\""
do shell script "echo \"puts [file atime filename]\" | tclsh"
If you have clisp or guile or some other scripting language handy they
probably support something similar.
If you have a port of the GNU coreutils package installed (e.g. via
fink or MacPorts), you can just use the stat command:
do shell script "stat -c %X filename"
--
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