How do I set a file's date stamp?

How do I set a file's date stamp?

Post by Charlie Gibb » Wed, 23 Apr 2003 16:41:37



I'm writing a program which, among other things, might copy an existing
file to another directory.  I'd like to set the new file's date stamps
the same as the original file's (i.e. work like cp -p).  I can get the
original file's date stamps with stat() - is there a way to insert this
information into the output file's inode?

--

\ /  I'm really at ac.dekanfrus if you read it the right way.
 X   Top-posted messages will probably be ignored.  See RFC1855.
/ \  HTML will DEFINITELY be ignored.  Join the ASCII ribbon campaign!

 
 
 

How do I set a file's date stamp?

Post by Stephane CHAZELA » Wed, 23 Apr 2003 18:06:29


utime(2)

 
 
 

How do I set a file's date stamp?

Post by Charlie Gibb » Thu, 24 Apr 2003 05:16:11




>utime(2)

Many thanks!

--

\ /  I'm really at ac.dekanfrus if you read it the right way.
 X   Top-posted messages will probably be ignored.  See RFC1855.
/ \  HTML will DEFINITELY be ignored.  Join the ASCII ribbon campaign!

 
 
 

1. 'JAN 1 1970' date stamp

I understand this is the (perhaps) "born" date of Unix, but what does it
mean when I have this date stamp on a directory when the directory has been
current before? ( Remove the Spam trap if responding through e-mail)
Thanx in advance PeTe D.

--

--
Nobody goes there anymore; it's too crowded - Yogi Berra
--

2. Hmmmmmm. Help! SLS-1.02 X - problem

3. Date stamping commands in the shell command history file

4. Collecting mail, and running apps remotely

5. Changing File Modified Time/Date Stamp

6. Cheap external modem

7. file date stamp

8. relaying e-mail from win95 thru my Linux box

9. Changing File Modified Time/Date Stamp

10. Keeping With Stamped Date On Downloaded Files

11. Date stamping commands in the history file in ksh

12. How do you reset file date time stamp

13. time and date stamp of a file