cposixfreebsdstatposix-api

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


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?


Solution

  • 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.