filemtime doesn't always copy correctly
| From: | David T. Kotchen | Date: | Sun, 06 Nov 2005 13:37:28 +0000 |
| Subject: | filemtime doesn't always copy correctly | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-225207@lists.php.net to get a copy of this message | ||
I am backing up a file (the path & filename of which are stored in $original; the path &
filename of the copy are stored in $bkup). I would also like to copy the file modification time of
$original, so, after copying the file itself, I use:
touch($bkup, filemtime($original));
However, after I use the above "touch" function, filemtime($original) and
filemtime($bkup) are often slightly different. For example, I might have:
echo filemtime($original); // gives 1126191599
echo filemtime($bkup); // gives 1126191600
Why the small difference?
(I'd like these two file modification times to be exactly the same because I want to compare
file modification times when I do incremental backups, and copy a file only if the file
modification times are different.)
By the way, if it helps, I am using Windows XP.
Thanks!