Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux distros: btime #22

Open
wizardion opened this issue May 30, 2022 · 3 comments
Open

Linux distros: btime #22

wizardion opened this issue May 30, 2022 · 3 comments
Labels
help wanted Extra attention is needed

Comments

@wizardion
Copy link

I saw the "Caveats" in the description, and the btime for Linux distros does not support be setting...
But for curiosity, is it possible that this feature will be implemented? I'm interested in the "created date" field of a file.

Linux distro: Ubuntu server 20.04.

@baileyherbert
Copy link
Owner

Well, the reason for this caveat is that linux doesn't have a btime stat, it's not part of the specification at all. If you run the stat command on a file, you shouldn't see any sort of creation time listed for this reason.

A quick search reveals that the specification allows for additional, non-standard timestamps to files (such as btime) but I'm not sure how it works or whether a creation timestamp would be stored the same way across all linux systems. 🤔

@wizardion
Copy link
Author

And what about ‘crtime’? I saw some articles on the internet that for the filesystems like ext4 – crtime is supported…

@baileyherbert
Copy link
Owner

baileyherbert commented Jun 4, 2022

It seems like that's true, but I'm not experienced enough with linux development to know how to set such a timestamp, and research yielded few results. We're currently using utimensat() which doesn't support btime. I found attempts to add btime to it, but they were largely rejected with reasons such as "btime should be read-only" and it's "inconsistent behavior".

I would welcome a PR as long as it doesn't cause problems on other filesystems or introduce any unexpected behavior, but this is out of scope for me personally.

@baileyherbert baileyherbert added the help wanted Extra attention is needed label Jun 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants