Debian Bug report logs -
#489905
findutils: -size -1M gives only files of zero length
Reply or subscribe to this bug.
Toggle useless messages
Report forwarded to debian-bugs-dist@lists.debian.org, Francesco Potorti` <pot@potorti.it>, Andreas Metzler <ametzler@debian.org>:
Bug#489905; Package findutils.
(full text, mbox, link).
Acknowledgement sent to Francesco Potorti` <Potorti@isti.cnr.it>:
New Bug report received and forwarded. Copy sent to Francesco Potorti` <pot@potorti.it>, Andreas Metzler <ametzler@debian.org>.
(full text, mbox, link).
Message #5 received at submit@bugs.debian.org (full text, mbox, reply):
Package: findutils
Version: 4.4.0-2
Severity: normal
File: /usr/bin/find
the outputs of
find . -size -1M
find . -size -1000k
are different: the former only gives files of null length.
I think this is a bug.
However, given the wording in the manual, it may be intended behaviour.
If this is the case, this particular case should be prominently
documented in the manual at the palce where where -size is described.
-- System Information:
Debian Release: lenny/sid
APT prefers testing
APT policy: (990, 'testing'), (500, 'testing-proposed-updates')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.24-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=it_IT@euro (charmap=ANSI_X3.4-1968) (ignored: LC_ALL set to C)
Shell: /bin/sh linked to /bin/bash
Versions of packages findutils depends on:
ii libc6 2.7-10 GNU C Library: Shared libraries
findutils recommends no packages.
-- no debconf information
Information forwarded to debian-bugs-dist@lists.debian.org, Andreas Metzler <ametzler@debian.org>:
Bug#489905; Package findutils.
(full text, mbox, link).
Acknowledgement sent to Andreas Metzler <ametzler@downhill.at.eu.org>:
Extra info received and forwarded to list. Copy sent to Andreas Metzler <ametzler@debian.org>.
(full text, mbox, link).
Message #10 received at 489905@bugs.debian.org (full text, mbox, reply):
On 2008-07-08 Francesco Potorti` <Potorti@isti.cnr.it> wrote:
> Package: findutils
> Version: 4.4.0-2
> Severity: normal
> File: /usr/bin/find
> the outputs of
> find . -size -1M
> find . -size -1000k
> are different: the former only gives files of null length.
> I think this is a bug.
> However, given the wording in the manual, it may be intended behaviour.
> If this is the case, this particular case should be prominently
> documented in the manual at the palce where where -size is described.
Well, it is documented in the manual:
---------------------
The number can be prefixed with a `+' or a `-'. A plus sign
indicates that the test should succeed if the file uses at least N
units of storage (a common use of this test) and a minus sign
indicates that the test should succeed if the file uses less than
N units of storage. There is no `=' prefix, because that's the
default anyway.
---------------------
Any suggestions on making it even more explicit?
cu andreas
--
`What a good friend you are to him, Dr. Maturin. His other friends are
so grateful to you.'
`I sew his ears on from time to time, sure'
Information forwarded to debian-bugs-dist@lists.debian.org, Andreas Metzler <ametzler@debian.org>:
Bug#489905; Package findutils.
(full text, mbox, link).
Acknowledgement sent to Francesco Potorti` <Potorti@isti.cnr.it>:
Extra info received and forwarded to list. Copy sent to Andreas Metzler <ametzler@debian.org>.
(full text, mbox, link).
Message #15 received at 489905@bugs.debian.org (full text, mbox, reply):
>> the outputs of
>> find . -size -1M
>> find . -size -1000k
>> are different: the former only gives files of null length.
>
>> I think this is a bug.
>
>> However, given the wording in the manual, it may be intended behaviour.
>
>> If this is the case, this particular case should be prominently
>> documented in the manual at the palce where where -size is described.
>
>Well, it is documented in the manual:
>
>---------------------
> The number can be prefixed with a `+' or a `-'. A plus sign
> indicates that the test should succeed if the file uses at least N
> units of storage (a common use of this test) and a minus sign
> indicates that the test should succeed if the file uses less than
> N units of storage. There is no `=' prefix, because that's the
> default anyway.
>---------------------
The fact that "less than 1 1GB-units of storage" means "0 bytes" may be
clear only in algorithmic terms. Normally people would read it as in
the natural usage: I want files less than 1GB in size, and I abbreviate
it as "-1GB". The problem is not in the definition of "+" and "-". It
is in the definition of multiples in the -size description:
----------------
File uses n units of space. The following suffixes can be used:
[...]
`M' for Megabytes (units of 1048576 bytes)
`G' for Gigabytes (units of 1073741824 bytes)
----------------
where the implications of "units of" is not obvious.
I think that adding a warning similar to this one would greatly clarify
things:
====
Notice that, while -size +5MB is true whenever the file is longer than 5
Megabytes, -size -5MB is true for files fitting in less than 5 MB units
of storage, i.e., for files whose lenght is 4 Megabytes or less;
consequently, -size -1MB is the same as -size 0.
====
Send a report that this bug log contains spam.
Debian bug tracking system administrator <owner@bugs.debian.org>.
Last modified:
Sat Dec 23 16:16:22 2023;
Machine Name:
buxtehude
Debian Bug tracking system
Debbugs is free software and licensed under the terms of the GNU
Public License version 2. The current version can be obtained
from https://bugs.debian.org/debbugs-source/.
Copyright © 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson,
2005-2017 Don Armstrong, and many other contributors.