php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35125 "touch" often gives incorrect file modification time
Submitted: 2005-11-06 15:08 UTC Modified: 2005-11-06 15:41 UTC
From: dmceo415 at yahoo dot com Assigned:
Status: Not a bug Package: Filesystem function related
PHP Version: 5.0.5 OS: Windows XP
Private report: No CVE-ID: None
 [2005-11-06 15:08 UTC] dmceo415 at yahoo dot com
Description:
------------
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

The "touch" function seems to be giving a slightly incorrect file modification time.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-11-06 15:39 UTC] sniper@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

We only attach to the libc function. If windows misbehaves -> not our problem, report to Microsoft.

 [2005-11-06 15:41 UTC] sniper@php.net
Also note that filemtime() result is cached. (RTFM)

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 08 23:01:33 2024 UTC