php.net |  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
Votes:2
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
 [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:\....


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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] derick@php.net
This should be fixed, can you try a windows snapshot (stable branch) from snaps.php.net/win32 ?

Derick
 [2002-05-10 15:49 UTC] derick@php.net
Fixed
 [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..

<?php
$f = "./test";
touch($f);
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 20:04:13 2023 UTC