From owner-freebsd-questions Fri Dec 30 18:45:34 1994 Return-Path: questions-owner Received: (from root@localhost) by freefall.cdrom.com (8.6.9/8.6.6) id SAA07329 for questions-outgoing; Fri, 30 Dec 1994 18:45:34 -0800 Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.34]) by freefall.cdrom.com (8.6.9/8.6.6) with ESMTP id SAA07323; Fri, 30 Dec 1994 18:45:24 -0800 Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.9/8.6.9) id NAA19380; Sat, 31 Dec 1994 13:44:08 +1100 Date: Sat, 31 Dec 1994 13:44:08 +1100 From: Bruce Evans Message-Id: <199412310244.NAA19380@godzilla.zeta.org.au> To: crtb@upcoming.dcrt.nih.gov, terry@cs.weber.edu Subject: Re: Why does ls report wrong creation date on symlinks? Cc: freebsd-bugs@freebsd.org, freebsd-questions@freebsd.org Sender: questions-owner@freebsd.org Precedence: bulk >> I had previously noted that all directories in a MSDOSFS tree carry >> as their creation date, the current moment. Somebody suggested that >> this was a capricious choice, in view of the impossibility of >> duplicating the creation date which DOS would report. I wonder >> if there is a link between these two bugs. No, there is no link between them. I fixed msdosfs in FreeBSD-current to report the same date for directories as DOS does. DOS never changes the date for directories after it creates them. This isn't as close as possible to POSIX conformance, but neither is stamping directories with the current timestamp. >UNIX and UNIX like OS's (and POSIX implementing OS's, for that matter) >don't keep an absolute file creation time. They keep a change time >(file metadata -- "stat information" -- has changed), a modification >time (file contents have changed), and an access time (a read operation >has occurred on the file). DOS keeps only one timestamp, which is the modification time for files and the creation time for directories. >What you are seeing is not a creation date, unless you are directly >accessing the file system directory blocks in the DOS FS. Instead, >depending on your options to 'ls', you are seeing one of the dates >the is reported in a POSIX compliant FS, but which DOS does not >maintain (the modification time). ls reports the modification time by default, and stat() fills in the times for directories as follows: FreeBSD-1.1.5 FreeBSD-2.0 FreeBSD-current atime creation time creation time creation time ctime creation time current time creation time mtime creation time current time creation time Other msdfosfs implementations change the directory time when the directory is modified. The FreeBSD-2.0 implementation goes to special trouble to avoid changing it. There should be a mount option to control the behaviour. >It is precisely the fact that a DOS file system can not store all of >the date information required by POSIX that makes it impossible to >produce a POSIX compliant DOS file system. The DOS FS simply can >not comply with the POSIX "shall mark for update" and "shall update" >directives. >POSIX leaves a loophole, allowing read-only media to ignore the >update requirements -- so you can be technically compliant if you >mount the disk read-only. Very useful. 8-). Pretending that directories were modified at the current time breaks even this :-). Bruce