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

File creation time stx_btime #12416

Open
phil294 opened this issue Aug 26, 2022 · 1 comment
Open

File creation time stx_btime #12416

phil294 opened this issue Aug 26, 2022 · 1 comment

Comments

@phil294
Copy link

phil294 commented Aug 26, 2022

Feature Request

Currently on Linux, only st_atim, st_mtim, st_ctim from stat(2) are bound, but since 2018 there's also stx_btim from statx(2) for creation time. It would be neat to be able to access that without writing custom LibC bindings. Creation time is also often available on other systems afaik.

Besides, only mtim is directly available via File's modification_time, there is e.g. no access_time. I assume that was intentional, but if necessary, one can get to those properties also with Crystal::System::File.stat like Crystal internally does.

Admittedly querying creation time is an uncommon use case... but I needed it so I thought it's worth opening an issue anyway

@straight-shoota
Copy link
Member

This was briefly mentioned in #5584 (comment)
The reason it's not included is that support is very scarce and it's hard to make it portable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants