[php-src] Issue #14900: Set file creation/change time in touch

From: Date: Wed, 10 Jul 2024 12:01:15 +0000
Subject: [php-src] Issue #14900: Set file creation/change time in touch
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-247265@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/14900 Author: andre5x ### Description With the touch function you can set the modification and access time, but not the creation/change time. I have several Windows applications where I need to set the creation time, for example a backup tool that needs to preserve the creation time. I have solved that with a C program that can set creation, modification and access times and that can be invoked from PHP using (Unix) sockets. But that is a relatively complicated solution, it would be much simpler/neater if you could set the creation time using touch. It would also be nice if the copy function would have a flag to preserve ctime, mtime and a time. In that case a touch to reset ctime, mtime and atime would not be needed at all. But I have a PHP tool that sets ctime and mtime of JPG files based on the ctime and mtime in the Exif header, for that I need the touch solution. A flag in the copy function would be a partial solution, setting ctime with touch is a more general and complete solution.

« previous php.bugs (#247265) next »