• 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: last opened
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >Re: last opened (From: Vince Angeloni <email@hidden>)

  • Prev by Date: Open for access with write permission
  • Next by Date: Re: do shell hanging
  • Previous by thread: Re: last opened
  • Next by thread: Query regarding duplicating Quark Layers
  • Index(es):
    • Date
    • Thread