Add a New Comment (Rich Markup)
> On Linux, `find -printf %BT` produces empty string even if the operating system and filesystem support birth times.
That's true, but GNU/Linux does not provide it via the stat() system call but via statx() instead. And that's what I wrote in comment #1: we'll have to change find(1) to the statx() system call like ls(1) does to support birth time on GNU/Linux.
> This directive produces an empty string if the underlying > operating system or filesystem does not support birth times.
I do not think the above statement is accurate. On Linux, `find -printf %BT` produces empty string even if the operating system and filesystem support birth times.
It seems this took a while ... I pushed the commit to document the %B format directive of `find -printf` at: https://git.savannah.gnu.org/cgit/findutils.git/commit/?id=b1b58be2b290ffa600988e747d29bd8759a61052
Well, find(1) does support birth time - both in -newerXY (with 'B' for X or Y) and in -printf '%Bk' (with the time format as specified by k like for %Ak, %Ck and %Tk). It's in since 2007: https://git.sv.gnu.org/cgit/findutils.git/commit/?id=4d3b4e4a285f The implementation relies on the support of the underlying stat(2)/lstat(2) functions and whether the struct stat provides the birth time. Unfortunately, our main platform GNU/Linux does not have it. Instead, we'd have to switch to the newer statx(2) function like in coreutils' ls(1) or stat(1). Finally, the documentation for -printf %Bk is missing. I'll come up with a documentation patch soon.
These days file managers, ls and stat (--printf=%w) support birth time. Is there a plan for find to support printing birth time in the future?
(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)
Attach Files: Comment:
No files currently attached
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Only logged-in users can vote.
Please enter the title of George Orwell's famous dystopian book (it's a date):
Follow 3 latest changes.
Copyright © 2023 Free Software Foundation, Inc. Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved. The Levitating, Meditating, Flute-playing Gnu logo is a GNU GPL'ed image provided by the Nevrax Design Team. Source Code
Powered by Savane 3.11