Re: Posix and Single Unix -- atime and mtime changes

Stephen C. Tweedie (sct@redhat.com)
Mon, 14 Dec 1998 20:53:43 GMT


Hi,

On Sun, 13 Dec 1998 19:39:49 -0600, Trever Adams
<highlander@teleteam.net> said:

> Below is a message that has a partial correspondence between myself and
> the current maintainer of leafnode. He and I have found some
> strangeness in the latest version. As the message explains, if you read
> the quotes, it seems it is due to Linux not modifying atime and mtime
> when it is opened but not written as shown in the code snippet below. I
> am not familiar enough with Posix and Single Unix Spec. to say for sure
> if what Linux does is correct or not, though, as my comments in the
> quotes show, I do not believe it is correct.

I have just looked at both posix.1 and singleunix. The mtime/ctime are
only required to be set if we have truncated or created the file. A
normal open, even for write, does not not update mtime by itself: you
actually have to write to the data to do that.

>> > Arnt Gulbrandsen and I were under the impression that opening a file would
>> > necessarily change its atime and mtime (this is how it is described in
>> > Stevens). It appears that this is not the case under Linux (I did some
>> > testing). Therefore the next version of leafnode will set the atime and
>> > mtime of these files by calling utime() instead.

--Stephen

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/