[R-SIG-Mac] File creation date

Julin Maloof jnmaloof at ucdavis.edu
Wed Oct 29 16:58:42 CET 2008


Hi Loren,

Try the following.  You need to have XCode developer tools installed.  Assumes that you working directory is where the files of interest are.  Otherwise add a path to the ls command.



files <- system("ls",intern=T)

date <- vector(mode="character",length=length(files))

names(date) <- files

for (f in files) {
	date[f] <- system(paste("/Developer/Tools/GetFileInfo -d '",f,"'",sep=""), intern=T)
	}
	


> Message: 1
> Date: Tue, 28 Oct 2008 16:03:35 -0700
> From: Loren Engrav <engrav at u.washington.edu>
> Subject: Re: [R-SIG-Mac] File creation date
> To: "r-sig-mac at stat.math.ethz.ch" <r-sig-mac at stat.math.ethz.ch>
> Message-ID: <C52CE857.1BFF5%engrav at u.washington.edu>
> Content-Type: text/plain;	charset="US-ASCII"
> 
> Sorry my email was unclear
> I am looking at files within a saved R workspace
> 
> The date of the workspace file is 3/18/2007 but I don't think all of the
> files were created on that date as I think I used the workspace over some
> period of time
> 
> So I would like the creation date of the files WITHIN the workspace
> 
> Maybe I should be asking this on the R email list
> 
> 
>> From: Steve Lianoglou <mailinglist.honeypot at gmail.com>
>> Date: Tue, 28 Oct 2008 18:48:34 -0400
>> To: Loren Engrav <engrav at u.washington.edu>
>> Cc: "r-sig-mac at stat.math.ethz.ch" <r-sig-mac at stat.math.ethz.ch>
>> Subject: Re: [R-SIG-Mac] File creation date
>>
>> Hi,
>>
>> On Oct 28, 2008, at 6:00 PM, Loren Engrav wrote:
>>
>>> Ok, I give up
>>>
>>> I am exploring some workspace files created long long ago
>>> And need the creation date of some of the files
>>>
>>> I try ls() but cannot see the parameters to show creation date
>>> I try file.info and get NA
>>> How do I get creation date to show
>> One way is to navigate to the file via the Finder, select it, and hit
>> Cmd-I (File > Get Info)
>>
>> You'll find what you're looking for in the "General" section.
>>
>> HTH,
>> -steve
>>
>> --
>> Steve Lianoglou
>> Graduate Student: Physiology, Biophysics and Systems Biology
>> Weill Medical College of Cornell University
>>
>> http://cbio.mskcc.org/~lianos
>>
>>
>>


-- 
Julin Maloof
Assistant Professor
Section of Plant Biology
University of California, Davis
1 Shields Ave
Davis, CA, 95616

voice: (530) 752-8077
fax:   (530) 752-5410



More information about the R-SIG-Mac mailing list