[Bug 16045] New: find -size <number-without-suffix> handling not POSIX compliant

bugzilla at busybox.net bugzilla at busybox.net
Sun Apr 21 13:57:44 UTC 2024


https://bugs.busybox.net/show_bug.cgi?id=16045

            Bug ID: 16045
           Summary: find -size <number-without-suffix> handling not POSIX
                    compliant
           Product: Busybox
           Version: 1.37.x
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P5
         Component: Standard Compliance
          Assignee: unassigned at busybox.net
          Reporter: stephane+bb at chazelas.org
                CC: busybox-cvs at busybox.net
  Target Milestone: ---

Per POSIX
(https://pubs.opengroup.org/onlinepubs/9699919799.2018edition/utilities/find.html)

find . -size n

is meant to return the files whose size rounded up to an integer number of
512-byte units is 1.

For instance, `find . -size 1` is meant to report the files whose size ranges
from 1 to 512 bytes (the ones that would typically occupy one sector of disk
space in the olden days).

But for busybox (and toybox, which shares the same non-conformance), it only
reports files whose size is exactly 512.

There are similar problems for `find . -size +n` and `find . -size -n`.

Note the behaviour when using suffixes other than `c` is fine as out of the
POSIX scope and is aligned with most other implementations that support those
or some of those suffixes (except GNU `find`).

See
https://unix.stackexchange.com/questions/774817/what-are-the-file-size-options-for-find-size-command/774840#774840
for more of the gory details including comparison with other implementations.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the busybox-cvs mailing list