Daemon News Ezine BSD News BSD Mall BSD Support Forum BSD Advocacy BSD Updates

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why does ls report wrong creation date on symlinks?



> 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.

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).

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).

The DOS FS doesn't have this information to give back to you, so it
makes something up -- the most convenient thing being the current time.

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-).


Whether the made up information comes from some date that DOS supports
or from the current time or from wherever is really at the programmers
option, since the thing will never conform to an existing standard for
doing such things (there *is* no such standard).


You can optionally use '-c' or '-u' as arguments to 'ls' to get at
date information DOS does store.


					Terry Lambert
					terry@xxxxxxxxxxxx
---
Any opinions in this posting are my own and not those of my present
or previous employers.