On Wed, 13 Feb 2008, mouss wrote:
Bill Cole wrote:
At 12:21 AM -0500 2/13/08, Benjamin R. Haskell imposed structure on a stream of electrons, yielding:
[...] Under most *nix filesystems, ctime is the last time the inode underlying the file/dir was changed ('c' for "changed", not "created" -- [usually]). The inode gets changed when the file's moved from one directory to another.
Not on all filesystems. Note what HFS+ (MacOS) does:
~ $ ls -lc foo -rwxr-xr-x 1 wkc wkc 332 Jan 29 03:32 foo ~ $ mkdir foodir ~ $ mv foo foodir ~ $ ls -lc foodir/foo -rwxr-xr-x 1 wkc wkc 332 Jan 29 03:32 foodir/foo ~ $ date Wed Feb 13 08:39:24 EST 2008
The question is whether this is because of an fs limitation or is it for compatibility with some old tools.
Posix says:
Upon successful completion, /rename/() shall mark for update the /st_ctime/ and /st_mtime/ fields of the parent directory of each file.
We haven't seen the ctime or mtime of the parent directory. Just of the file.
and ctime is the last status change time. AFAICT, an mv is certainly a status change.
but maybe I disgress:)