How to get file creation time?


#1

Does anybody know how to get file creation time in Julia 0.6?
I’ve tried several options, ctime() returns change time, and in most cases is equal to mtime(), similarly behave stat().mtime and stat().ctime. In documentation, for some reason, stat() ctime is wrongly called creation time, but in reality behaves as change time.


#2

At least on Linux, creation time isn’t very common (hopefully situation improved nowadays with ext4 and btrfs), are you sure your file system supports creation time at all?


#3

Clearly yes, both stat command line returns atime, mtime and ctime AND creation time, and Get Info in Finder also shows correct creation and modification times.


#4

This page on creation time in Python is helpful. It’s possible to access it via the stat call on MacOS and some other BSD systems, but accessing it on Linux (even if the filesystem supports it) is more difficult.

The Julia high-level stat call doesn’t support this info (presumably because it is not portable), but you could use ccall on MacOS to call the stat function yourself.