3 ms·
Just interpreting time as unsigned would take them to 2106. Probably there would be other filesystems to use before then. There are exactly zero XFS filesystem
by ncmncm 6y ago
Just interpreting time as unsigned would take them to 2106. Probably there would be other filesystems to use before then.
There are exactly zero XFS filesystem files created before 1970, so there is no need to represent those times in a filesystem.
I seriously wonder what makes this basic fact so hard for so many people to process. If you have a clue, please do explain.
- quotemstr 6y ago> There are exactly zero XFS filesystem files created before 1970 But you can set the timestamp of a file to a time before the epoch. $ touch --date='Jun 1 1952' foo $ ls -l foo -rw------- 1 me me 0 Jun 1 1952 foo Silently changing the interpretation of these pre-epoch timestamps would break users and so isn't an option.
- ncmncm 6y agoObviously you can, but why should anyone care that you did? If you only care about the bit pattern (which must be the case, because the date is a lie), what does it matter how anybody interprets it?
- quotemstr 6y agoThe bit pattern as returned from stat would be different: that's what makes it an ABI break. If I make a file with an mtime of 1952 and then I update the kernel and that file has an mtime of 2077 or something, that's the kernel violating the contract it has with userspace, and Linux does not break kernel ABI. It doesn't matter whether you think that such timestamps are "lie[s]": the contract is the contract. You have no idea how someone might be using the system, and you don't get to break uses that are legal within the contract but contrary to your sense of good taste.
- Dylan16807 6y ago> Linux does not break kernel ABI Yes it does. The rule isn't absolute. Impact matters, not your ability to find a single bit pattern that differs.
- Someone 6y agoThe date need not be a lie. One might have moved file systems a few times, migrating files each time, and preserving time stamps. Alternatively, if you find an early tape in a yard sale, you’ll want to keep creation dates of the files when you read in the data. Those are ‘somewhat’ of an edge case, though. And yes, it seems at least some file systems from before 1970 had time stamps. https://en.wikipedia.org/wiki/Comparison_of_file_systems#Metadata https://en.wikipedia.org/wiki/Comparison_of_file_systems#Met... says DECTape had, and that’s from 1963.