|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16835 Touch function can't modify the date/time of a file
Submitted: 2002-04-25 18:02 UTC Modified: 2002-05-10 15:49 UTC
Avg. Score:4.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:0 (0.0%)
From: v dot marco at libero dot it Assigned:
Status: Closed Package: Filesystem function related
PHP Version: 4.2.0 OS: Windows
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: v dot marco at libero dot it
New email:
PHP Version: OS:


 [2002-04-25 18:02 UTC] v dot marco at libero dot it
Touch function can't modify the date/time of a file.

When try to call that function PHP always reply with:

Warning: utime failed: Invalid argument in d:\....


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-05-05 01:57 UTC] e9626334 at stud3 dot tuwien dot ac dot at
I believe this may be a symptom of the same bug: on FreeBSD 4.5-RELEASE (x86), PHP 4.2.0's touch() function, at least when being called without the optional time argument, sets a wrong date on touched files. In my case, it's April 23, 1991(!). My system date _is_ correct; and touch(1) does work fine. 

This problem is 100% reproducible and did not exist in PHP 4.1.2 or any previous 4.x releases.
 [2002-05-05 03:19 UTC]
This should be fixed, can you try a windows snapshot (stable branch) from ?

 [2002-05-10 15:49 UTC]
 [2002-09-16 11:02 UTC] donald at design dot za dot net
I am still getting the problem in version 4.2.3
touch() will not update my file time..

$f = "./test";
echo filectime($f)."<br>";

always returns the same value in windows, but on a unix platform the time does change.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed Feb 01 07:05:52 2023 UTC