Bug #78381 [Com]: touch() with time-params does not set file modification date on Windows
| From: | ron at ronsteiner dot info | Date: | Tue, 06 Aug 2019 13:37:28 +0000 |
| Subject: | Bug #78381 [Com]: touch() with time-params does not set file modification date on Windows | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-222105@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=78381&edit=1
ID: 78381
Comment by: ron at ronsteiner dot info
Reported by: andrey dot sperkach at gmail dot com
Summary: touch() with time-params does not set file
modification date on Windows
Status: Feedback
Type: Bug
Package: *Directory/Filesystem functions
Operating System: Windows 10
PHP Version: 7.3.8
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
This is also happening to me with 7.2.21 on Windows Server 2012 and 2016. Works fine with 7.2.20.
Previous Comments:
------------------------------------------------------------------------
[2019-08-06 13:25:55] cmb@php.net
I'm not able to reproduce the described behavior. Are you working
on a local file system?
------------------------------------------------------------------------
[2019-08-06 12:42:25] andrey dot sperkach at gmail dot com
Description:
------------
touch() with time-params does not set file modification date
PHP 7.0.x not affected by this problem
PHP 7.3.8 set it to 1970.01.01 - wrong
BUT:
touch($file) without time-param set modification time to current datetime!
Test script:
---------------
$file = 'test.txt';
$current = file_get_contents($file);
$current = "TEST";
file_put_contents($file, $current);
touch($file,time()+86400);
Expected result:
----------------
modification time = current + 1 day
Actual result:
--------------
modification time = 1970.01.01 3:01:14
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=78381&edit=1