public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Fergus Daly <fergusd84@outlook.com>,
	"'cygwin@cygwin.com'" <cygwin@cygwin.com>
Subject: Re: Is it possible to alter Birth time?
Date: Thu, 8 Oct 2020 08:49:57 -0500	[thread overview]
Message-ID: <b0a08591-eadd-391f-80af-470414410c13@redhat.com> (raw)
In-Reply-To: <DB6PR03MB3013872D9D5E20F9F0213BDEA40B0@DB6PR03MB3013.eurprd03.prod.outlook.com>


[-- Attachment #1.1: Type: text/plain, Size: 1369 bytes --]

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


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2020-10-08 13:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-08  9:33 Fergus Daly
2020-10-08 13:49 ` Eric Blake [this message]
2020-10-12  7:09 ` Andrey Repin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b0a08591-eadd-391f-80af-470414410c13@redhat.com \
    --to=eblake@redhat.com \
    --cc=cygwin@cygwin.com \
    --cc=fergusd84@outlook.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).