On 10/8/20 4:33 AM, Fergus Daly via Cygwin wrote: > In Cygwin (and on some, not all, Linux file systems) the command > $ stat filename > shows all of Access, Modify, Change and Birth times of a file. > The command > $ touch [options] filename > will alter some or all of Access, Modify, Change times, as specified > in [options]. > Is it possible in Cygwin (or for that matter in Windows) to alter the > Birth time of a file or directory?
Not short of deleting the file and creating a new one in its place, and even then, the birthtime is controlled by the current system clock and not something you can modify after the fact. And that answer is identical to what you have on BSD or Linux, on file systems that support birth time there. And actually, touch can't modify the change time of a file to anything other than the current time; it is only access and modify times that can be set arbitrarily. (If you REALLY want to modify birth and change times, and have superuser access, you can open the raw block device and flip bits behind the file system's back - but that's not something you want to be doing on a regular basis, nor should you attempt it while a file system is mounted on that block device) -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature
-- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple