[BUG][Unix] ctime and mtime entries swapped in DirectoryEntry

Alexander Lazarević Alexander at Lazarevic.de
Wed Oct 22 13:55:53 UTC 2003


Am Mittwoch, 22. Oktober 2003 15:34 schrieb Randal L. Schwartz:
>         ctime - modified when file is opened for write, or when any
>                 metadata is changed (renamed, linked, utime'd, chowned, etc)

Is the ctime changed if a file is opened for write? I thought it just gets 
updated if the metadata changes? This is what I would read out of the gnu 
libc documentation.

Alex

File Times
----------

Each file has three time stamps associated with it:  its access time,
its modification time, and its attribute modification time.  These
correspond to the `st_atime', `st_mtime', and `st_ctime' members of the
`stat' structure; see *Note File Attributes::.

   All of these times are represented in calendar time format, as
`time_t' objects.  This data type is defined in `time.h'.  For more
information about representation and manipulation of time values, see
*Note Calendar Time::.

   Reading from a file updates its access time attribute, and writing
updates its modification time.  When a file is created, all three time
stamps for that file are set to the current time.  In addition, the
attribute change time and modification time fields of the directory that
contains the new entry are updated.

   Adding a new name for a file with the `link' function updates the
attribute change time field of the file being linked, and both the
attribute change time and modification time fields of the directory
containing the new name.  These same fields are affected if a file name
is deleted with `unlink', `remove' or `rmdir'.  Renaming a file with
`rename' affects only the attribute change time and modification time
fields of the two parent directories involved, and not the times for
the file being renamed.

   Changing the attributes of a file (for example, with `chmod')
updates its attribute change time field.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 155 bytes
Desc: signature
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20031022/811f3608/attachment.pgp


More information about the Squeak-dev mailing list