changed date
changed date
- Subject: changed date
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Sun, 20 Jan 2002 14:17:16 +0100
I have a file a (modification date 2) which contains "A"
and a_old (modification 1) which contains "Old"
and make a backup, which keeps the modification dates.
Now I do in a Terminal window: mv a a_x ; mv a_old a ; mv a_x a_old.
And I also set the modification date of a to 2 (via utimes() ).
Again a backup (which checks modification dates) results in:
a_old (modification date 2) - backed up again because file is newer,
contains "A"
a (modification date 2) - NOT backed up, because file (date2) a is same
as backup, still contains "A".
This clearly is no good.
So I make a better backup-program, which backes up files with
modification date OR changed date newer than backup modification date.
This works on Next (and probably any other Unix) because mv (and
changing the modification date) updates the changed date.
But on Mac OS X with HSF+ fileAttributesAtPath:traverseLink: returns a
dictionary which contains only the modification date. And the changed
date (which I could get via the BSD-function stat) is NOT updated by mv
(it is updated by chown).
So how do I know, whether to backup or not? Compare every byte of backup
to file? This sounds rather inefficient.
If the backup is also HFS+, is there some special HSF-magic to be used?
Gerriet.