Unix Question
Steve D. Miller
steve at umcp-cs.UUCP
Wed Nov 12 00:23:28 AEST 1986
In article <808 at mtund.UUCP> adam at mtund.UUCP (Adam V. Reed) writes:
>> I'll make this short and sweet:
>>
>> How can one change the date/time stamp of a file?
>>
>> I want to be able to put any date/time on a file that I
>> have in my directory...
>> Chuck Conway
>
>See touch(1) in the User Reference Manual (RTFM!).
The original poster does not want to put the *current* time on
the file...he wants to put *any* time on the file. There are three
timestamps associated with any file: the last access time, the
last modify time, and the "last time inode modified" time (the
a_time, m_time, and c_time fields of the structure returned by
stat(2)). The utimes(2) system call is probably the one you
want; it will set the access and modify times to whatever you
wish, and set the inode change time to the current time. See
the manual entry.
If you need to set the inode change time, you will have to
fool with the raw disk device. If you really need to do so,
I can probably scrounge up more information for you.
-Steve
--
Spoken: Steve Miller ARPA: steve at mimsy.umd.edu Phone: +1-301-454-4251
CSNet: steve at umcp-cs UUCP: {seismo,allegra}!umcp-cs!steve
USPS: Computer Science Dept., University of Maryland, College Park, MD 20742
More information about the Comp.unix.questions
mailing list