Set file creation/change time in touch
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 40.4k
- Forks
- 8.1k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 96
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the existing touch and copy entry points in PHP, then examine how Windows represents creation time versus modification and access times. Define the supported semantics for setting or preserving these timestamps and verify the behavior across the relevant platforms; done means the requested timestamp handling is specified and covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, php
- Domain
- backend, operating-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100