Get creation time of a file on a NTFS filesystem (Unix)

Hi there!

I'm currently working on a project where I need to access the creation time (not modification or access time) of a list of files stored on a NTFS device (mounted through ntfs-3g). The program runs on Linux. Unfortunately, using file_path.metadata().unwrap().created() returns an Err variant indicating the created timestamp feature is not supported.

How can I solve this problem?

Thanks in advance for your help!

The creation date appears to be available via ntfs-3g as an extended attribute called system.ntfs_crtime rather than via the normal metadata() call: Using Extended Attributes · tuxera/ntfs-3g Wiki · GitHub

You should be able to retrieve this using getxattr in the libc crate. I don’t have an ntfs-3g filesystem to try this out on myself, though.

1 Like

So there's no way to get this value through std then... :confused:
Thanks for your help, I'll look into libc to see if it fits my needs :slight_smile:

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.