8

I'm trying to print file date of birth ( crtime ), I'm working with ext4 and support for crtime enable:

stat a
  File: a
  Size: 0           Blocks: 0          IO Block: 4096   regular empty file
Device: 254,5   Inode: 393233      Links: 1
Access: (0644/-rw-r--r--)  Uid: ( 1006/    user)   Gid: ( 1006/    user)
Access: 2024-06-24 13:35:25.672343713 +0200
Modify: 2024-06-24 13:35:25.672343713 +0200
Change: 2024-06-24 13:35:25.672343713 +0200
 Birth: 2024-06-24 13:35:25.672343713 +0200

when trying to display date of birt with find -printf '%B@' as the manual indicate :

%Bk    File's  birth  time,  i.e., its creation time, in the format 
specified by k, which is the same as for %A. 
This directive produces an empty string if the underlying operating 
system  or  filesystem does not support birth times.

I get that result :

find -name a -printf '%B@ %p\n' 
-1.-000000010 ./a

Is it a bug or is it a feature I don't know about or something else. I'm using find version 4.9.0-5 (and tested version -4 as well).

I've tried on Ubuntu and Debian.

4

1 Answer 1

12

This is a known bug: Linux exposes the creation time via the new statx system call whereas GNU find uses the traditional stat/lstat. Other GNU utilities have made the switch but not find.

3
  • 3
    I'm not crazy then. Thank you for the clear explanation.
    – Kiwy
    Commented Jun 24 at 12:47
  • Not really a bug, it's just it's not implemented yet for Linux-based operating systems. Commented Jun 25 at 6:43
  • 1
    @StéphaneChazelas with how is written the manual I'd argue it is a bug on a user perspective :-D
    – Kiwy
    Commented Jun 25 at 12:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .