>> 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.
====



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to