Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upThe "ctime" field from stat is not time of file creation. #15168
Comments
alexcrichton
added
A-iOS
and removed
A-iOS
labels
Jun 28, 2014
This comment has been minimized.
This comment has been minimized.
|
Indeed! Looks like we need to switch to |
alexcrichton
added
the
E-easy
label
Jun 28, 2014
This comment has been minimized.
This comment has been minimized.
pdovy
commented
Jul 8, 2014
|
I took a look at this as it seemed like possibly an easy first issue. On Windows, Do we have any ability to have platform-dependent code in src/libnative/io/file_unix.rs? It seems like the right approach may be to have an additional field on |
This comment has been minimized.
This comment has been minimized.
|
FYI: |
This comment has been minimized.
This comment has been minimized.
|
OS X and *BSD do have the ability to get creation time via |
This comment has been minimized.
This comment has been minimized.
|
@thestinger just experimented on ext4 and neither crtime nor btime are returned by the stat systemcall. maybe there's some other syscall that will expose that variable. investigating.. |
This comment has been minimized.
This comment has been minimized.
|
On Linux, you can get creation time via debugfs if you are root. AFAIK (and, according to the Ruby's discussion linked from my previous comment,) there is no way to get it on Linux via any system call for now. |
This comment has been minimized.
This comment has been minimized.
|
i took a preliminary stab at it in #17272, could someone let me know if I'm on the right track? |
salemtalha
referenced this issue
Sep 16, 2014
Closed
fix for platform inconsistency in creation time #17272
alexcrichton
referenced this issue
Jan 11, 2015
Closed
`std::io::FileStat` has a field named `created`, but it's not its creation time #20946
This comment has been minimized.
This comment has been minimized.
|
This was handled in the new |
zookoatleastauthoritycom commentedJun 25, 2014
rust/src/libstd/io/fs.rs
Line 332 in 108b8b6
stat_ctimethen this is a bug, becausestat_ctimeis not the time of file creation, but is instead the most recent time that either the content or the metadata of the file changed: https://en.wikipedia.org/wiki/Stat_%28Unix%29#ctime