File birth time
File birth time (btime) is a filesystem timestamp recording file creation, distinct from modification time and inode change time.
On Linux, stat() does not return btime. statx() can return it as stx_btime where supported. Request STATX_BTIME and check that the returned stx_mask contains STATX_BTIME before interpreting the value; a successful call does not guarantee that every requested field was supplied. [2]
Availability depends on the kernel and filesystem. Do not substitute ctime for missing birth time. [1]
Relations
Advantages
- Separates recorded file creation from later content and inode-status changes.
Limitations
- Not exposed by the traditional Linux stat() structure.
- May be unavailable even when statx() succeeds.