[bug #62480] find -D stat cannot print anything

Bernhard Voelker <[email protected]>
Newsgroups gmane.comp.gnu.findutils.bugs
Message-ID <[email protected]>
Update of bug #62480 (project findutils):

                  Status:                    None => Working as Intended    
             Assigned to:                    None => berny                  

    _______________________________________________________

Follow-up Comment #1:

The point is that `find` does not have to invoke stat() for
an invocation using the default -print.  Reading the directory
entries is sufficient for that.

One has to use tests or actions which need a stat(), e.g.:

# Prepare some files with different size.
$ touch f0
$ for f in 1 100 1000; do if=/dev/zero bs=1 count=$f > f$f; done

# -ls needs stat().
$ find -D stat -ls
   409613      4 drwxr-xr-x   2 berny    users        4096 May 17 17:07 .
debug_stat (f0)
   394313      0 -rw-r--r--   1 berny    users           0 May 17 17:07 ./f0
debug_stat (f100)
   393551      0 -rw-r--r--   1 berny    users           0 May 17 17:07
./f100
debug_stat (f1000)
   394287      0 -rw-r--r--   1 berny    users           0 May 17 17:07
./f1000
debug_stat (f1)
   393513      0 -rw-r--r--   1 berny    users           0 May 17 17:07 ./f1



# -size needs stat().
$ find -D stat . -size -300c
debug_stat (f0)
./f0
debug_stat (f100)
./f100
debug_stat (f1000)
./f1000
debug_stat (f1)
./f1


Therefore, -D stat works as expected.



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?62480>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.