Bug #78381 [Fbk]: touch() with time-params does not set file modification date on Windows
| From: | cmb@php.net | Date: | Tue, 06 Aug 2019 14:06:06 +0000 |
| Subject: | Bug #78381 [Fbk]: 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-222107@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
Updated by: cmb@php.net
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
+Operating System: Windows x86
PHP Version: 7.3.8
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Ah, can reproduce with x86 builds.
Previous Comments:
------------------------------------------------------------------------
[2019-08-06 13:46:03] cmb@php.net
This might be related to the fix for bug #78241. Are you using official PHP builds from
windows.php.net? If so, which ones exactly?
------------------------------------------------------------------------
[2019-08-06 13:37:28] ron at ronsteiner dot info
This is also happening to me with 7.2.21 on Windows Server 2012 and 2016. Works fine with 7.2.20.
------------------------------------------------------------------------
[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