``touch''ing a file in Ruby

R

Richard A. Ryan

Hi,

How do you change the mtime (and ctime and atime, if possible) of
a file in Ruby? I'll probably be running this on Solaris, IRIX,
and Linux.

Thank you,
Richard Ryan
 
Z

Zane Dodson

On Sat, Jul 31, 2004 at 11:41:41AM +0900, Richard A. Ryan wrote:
| Hi,
|
| How do you change the mtime (and ctime and atime, if possible) of
| a file in Ruby? I'll probably be running this on Solaris, IRIX,
| and Linux.

See File.utime.

Best regards,
 
D

daz

Richard said:
Hi,

How do you change the mtime (and ctime and atime, if possible) of
a file in Ruby? I'll probably be running this on Solaris, IRIX,
and Linux.


------------------------------------------------------------ File::utime
File.utime(atime, mtime, file_name,...) => integer
------------------------------------------------------------------------
Sets the access and modification times of each named file to the
first two arguments. Returns the number of file names in the
argument list.


Don't know about ctime, though.

:daz
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,479
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top