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: last opened



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: 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: last opened (From: Vince Angeloni <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.