changing the date/time stamp

M

monk

Is there a "perl way" of modifying the date/time stamp of a file? Is
there a core function or core module I'm overlooking?

I guess I'd like to emulate or find the equivalent of the 'touch'
command without using system ('touch...')

# from the shell, modify xfile creation date to year 2001 January day
30 time 13:50:26
touch -t 200101301350.26 xfile


thanks in advance.
 
P

Peter Makholm

monk said:
Is there a "perl way" of modifying the date/time stamp of a file? Is
there a core function or core module I'm overlooking?

See the documentation of the utime function in perlfunc.

//Makholm
 
T

Tad J McClellan

monk said:
Is there a "perl way" of modifying the date/time stamp of a file? Is
there a core function or core module I'm overlooking?


perldoc -f utime

# from the shell, modify xfile creation date to year 2001 January day ^^^^^^^^^^^^^
30 time 13:50:26
touch -t 200101301350.26 xfile


touch does NOT modify the creation date, because there is no
such thing on most *nix filesystems...
 

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

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top