[net.unix-wizards] File times in 4.23

jack@mcvax.uucp (Jack Jansen) (08/20/86)

Recently, we noticed that the behaviour of file access times under 4.3
is not according to the manual.  After checking the other times, we
found out that 4.2, 4.3 and the manual do complete different things:

Manual: access time changed by read, write and some others.
	modify time changed by write
	creation time changed by link, chmod, etc.
	
4.2:	access time changed by read *only*.
	modify time changed by write
	creation time changed by link, *but not chmod*.
	
4.3:	access time changed by read *only*.
	modify time changed by write
	creation time never changed (except by creation, of course).
	
Especially the fact that the access time doesn't change on write
looks like a bug to me....	
-- 
	Jack Jansen, jack@mcvax.UUCP
	The shell is my oyster.

guy@sun.uucp (Guy Harris) (08/21/86)

> 4.3:	access time changed by read *only*.
> 	modify time changed by write
> 	creation time never changed (except by creation, of course).

It's impossible to change the creation time on a UNIX file, since there
isn't one!  The "c" in "ctime" stands for "change", which is a somewhat
vague term; it actually refers to any change to the inode.  This definitely
includes "chmod"; I just rlogged into a machine here running straight 4.3BSD
(it's name is "sunvax", and it's a VAX-11/750) and created a file.  I did an
"ls -lc", waited about a minute, changed its mode, and did another "ls -lc".
Lo and behold, the inode change time had changed!

I don't know how you got those results for 4.2BSD and 4.3BSD, but either you
didn't do something right or your kernel is funny.
-- 
	Guy Harris
	{ihnp4, decvax, seismo, decwrl, ...}!sun!guy
	guy@sun.com (or guy@sun.arpa)

chris@umcp-cs.UUCP (Chris Torek) (08/21/86)

In article <7053@boring.mcvax.UUCP> jack@mcvax.uucp (Jack Jansen) writes:
>... we noticed that the behaviour of file access times under 4.3
>is not according to the manual. ...
>Manual: access time changed by read, write and some others.
>	modify time changed by write
>	creation time changed by link, chmod, etc.

Hold!  /There is no creation time!/  `ctime' is `last change' time.
It should be updated any time the disk inode is changed in any way,
so that the file is properly backed-up.

>4.2:	access time changed by read *only*.
>	modify time changed by write
>	creation time changed by link, *but not chmod*.

If chmod does not update inode ctimes, it is rather seriously broken.
A full restore of a file system could leave many files with the wrong
modes.

>4.3:	access time changed by read *only*.
>	modify time changed by write
>	creation time never changed (except by creation, of course).

This last is most certainly untrue.

>Especially the fact that the access time doesn't change on write
>looks like a bug to me....	

No: here the manual must be in error.  `access' means `read', more
or less.

The `ls' manual is buggy; it claims that `ls -c' sorts on, and/or
prints, file creation times, when in fact no such times are available.
Are there others that make similar claims?
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 1516)
UUCP:	seismo!umcp-cs!chris
CSNet:	chris@umcp-cs		ARPA:	chris@mimsy.umd.edu