Debian Bug report logs - #489905
findutils: -size -1M gives only files of zero length

version graph

Package: findutils; Maintainer for findutils is Andreas Metzler <ametzler@debian.org>; Source for findutils is src:findutils.

Reported by: Francesco Potorti` <Potorti@isti.cnr.it>

Date: Tue, 8 Jul 2008 16:33:02 UTC

Severity: normal

Found in version findutils/4.4.0-2

Forwarded to http://savannah.gnu.org/bugs/?12162

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


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 and rfc822 format available.

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 and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Francesco Potorti` <Potorti@isti.cnr.it>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: findutils: -size -1M gives only files of zero length
Date: Tue, 08 Jul 2008 18:12:52 +0200
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 and rfc822 format available.

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 and rfc822 format available.

Message #10 received at 489905@bugs.debian.org (full text, mbox):

From: Andreas Metzler <ametzler@downhill.at.eu.org>
To: Francesco Potorti` <Potorti@isti.cnr.it>, 489905@bugs.debian.org
Subject: Re: Bug#489905: findutils: -size -1M gives only files of zero length
Date: Tue, 8 Jul 2008 19:18:03 +0200
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 and rfc822 format available.

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 and rfc822 format available.

Message #15 received at 489905@bugs.debian.org (full text, mbox):

From: Francesco Potorti` <Potorti@isti.cnr.it>
To: Andreas Metzler <ametzler@downhill.at.eu.org>
Cc: 489905@bugs.debian.org
Subject: Re: Bug#489905: findutils: -size -1M gives only files of zero length
Date: Wed, 09 Jul 2008 12:46:19 +0200
>> 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.
====




Noted your statement that Bug has been forwarded to http://savannah.gnu.org/bugs/?12162. Request was from Andreas Metzler <ametzler@debian.org> to control@bugs.debian.org. (Sat, 16 Aug 2008 08:03:02 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Fri Apr 25 02:04:20 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.