[kwlug-disc] Reminder: bash's find has option -exec
Ron
ron at bclug.ca
Wed Nov 12 17:29:55 EST 2025
Giles Malet wrote on 2025-11-12 13:56:
> Noticeably absent here is the file creation time.
>
> struct stat {
> ...
> struct timespec st_atim; /* Time of last access */
> struct timespec st_mtim; /* Time of last modification */
> struct timespec st_ctim; /* Time of last status change */
>
> #define st_atime st_atim.tv_sec /* Backward compatibility */
> #define st_mtime st_mtim.tv_sec
> #define st_ctime st_ctim.tv_sec
> };
There's a newer `statx` system call that is available:
`man statx`
struct statx {
...
/* The following fields are file timestamps */
struct statx_timestamp stx_atime; /* Last access */
struct statx_timestamp stx_btime; /* *Creation* */
struct statx_timestamp stx_ctime; /* Last status change */
struct statx_timestamp stx_mtime; /* Last modification */
...
}
I emboldened the Creation struct on the 3rd from last line.
I'm guessing GNU's `find` v4.9.0 doesn't support that, even though it's
mentioned in `man find`:
> This directive produces an empty string if the underlying operating
> system or filesystem does not support birth times.
A wee bit misleading, as it seems `stat` and `ls` report birth times, so
OS and FS support present.
That is, if I'm understanding everything correctly? Not supported by
`stat` call, but by `statx`, a Linux specific thing. I'd have expected
GNU to support that.
General search for "birth" on the GNU `find` mailing list archive:
https://lists.gnu.org/archive/cgi-bin/namazu.cgi?query=birth&submit=Search%21&idxname=bug-findutils&max=20&result=normal&sort=date%3Alate
A somewhat recent thread about Linux statx:
https://lists.gnu.org/archive/html/bug-findutils/2024-05/msg00086.html
Thanks Giles
More information about the kwlug-disc
mailing list