# Is birthtime supported on FreeBSD



## Bostjan (Jul 24, 2019)

Timestamps of a file by posix are creation time, last modify time, last access time.



Does vanilla FreeBSD natevly records and supports ctime, mtime, atime and birthtime? Or is this property of filesystem? The filesystem in this case is ZFS. Can birthtime be changed? By which command?


----------



## SirDice (Jul 24, 2019)

Bostjan said:


> Does vanilla FreeBSD natevly records and supports ctime, mtime, atime and birthtime? Or is this property of filesystem?


Those are all filesystem properties.






						Comparison of file systems - Wikipedia
					






					en.wikipedia.org


----------



## SirDice (Jul 24, 2019)

You probably also want to read stat(2):

```
The time-related fields of struct stat are as follows:

     st_atim          Time when file data last accessed.  Changed implicitly
                      by syscalls such as read(2) and readv(2), and explicitly
                      by utimes(2).

     st_mtim          Time when file data last modified.  Changed implicitly
                      by syscalls such as truncate(2), write(2), and
                      writev(2), and explicitly by utimes(2).  Also, any
                      syscall which modifies directory content changes the
                      st_mtim for the affected directory.  For instance,
                      creat(2), mkdir(2), rename(2), link(2), and unlink(2).

     st_ctim          Time when file status was last changed (inode data
                      modification).  Changed implicitly by any syscall that
                      affects file metadata, including st_mtim, such as
                      chflags(2), chmod(2), chown(2), truncate(2), utimes(2),
                      and write(2).  Also, any syscall which modifies
                      directory content changes the st_ctim for the affected
                      directory.  For instance, creat(2), mkdir(2), rename(2),
                      link(2), and unlink(2).

     st_birthtim      Time when the inode was created.
```


----------

