Is there any standard way to get creation time of file or directory in FreeBSD programatically

589 Views Asked by At

I want to know how to get creation time of path in FreeBSD C API?

for example in Linux we can use statx since kernel 4.11, or in mac OSX we can use stat64

I want to know is there any way like above for FreeBSD? is there any POSIX standard function/syscall for this?

1

There are 1 best solutions below

2
On BEST ANSWER

POSIX's stat functions provide no way to get file creation time. However, FreeBSD has st_birthtim field which you can use.

From FreeBSD's stat syscall:

 st_birthtim  Time when the inode was created.