Your message dated Sat, 13 Jun 2015 07:55:04 +0200
with message-id <[email protected]>
and subject line Re: Bug#788427: findutils: find -size gives wrong results for
'M' units
has caused the Debian Bug report #788427,
regarding findutils: find -size gives wrong results for 'M' units
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
788427: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=788427
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: findutils
Version: 4.4.2-9+b1
Severity: important
Dear Maintainer,
The -size option to find behaves wrongly for the 'M' units. Not sure what is
going on there:
simon@mezzanine:/tmp/test$ dd if=/dev/zero of=fump.bin bs=1M count=1
1+0 records in
1+0 records out
1048576 bytes (1.0 MB) copied, 0.00309158 s, 339 MB/s
simon@mezzanine:/tmp/test$ dd if=/dev/zero of=bla.bin bs=512k count=1
1+0 records in
1+0 records out
524288 bytes (524 kB) copied, 0.00147233 s, 356 MB/s
simon@mezzanine:/tmp/test$ find . -size 1024k
./fump.bin
simon@mezzanine:/tmp/test$ find . -size 1M
.
./fump.bin
./bla.bin
I expect that both find invocations are equivalent and should give the
exact same results. The manpage specifies that 'M' are units
of 1048576 = 1024 * 1024 = 1024k bytes. It is totally unexpeced to me
that this also returns the (smaller) bla.bin file.
-- System Information:
Debian Release: stretch/sid
APT prefers unstable
APT policy: (990, 'unstable'), (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 4.0.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.utf8, LC_CTYPE=en_GB.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages findutils depends on:
ii libc6 2.19-18
findutils recommends no packages.
Versions of packages findutils suggests:
ii mlocate 0.26-1
-- no debconf information
--- End Message ---
--- Begin Message ---
On 2015-06-13 Simon Budig <[email protected]> wrote:
> Andreas Metzler ([email protected]) wrote:
> > How many units sized one Megabyte each is a 512k sized file using?
> > a) 0
> > b) 1
> > c) something else
> >
> > Obviously b. It uses some space, so it cannot be a).
> Ok. I see how it does that. I just hope that this has some historical
> reasoning relating to different media block sizes.
Hello,
I think that is where it comes from, POSIX mandates
-size n[c]
The primary shall evaluate as true if the file size in bytes,
divided by 512 and rounded up to the next integer, is n. If n is
followed by the character 'c', the size shall be in bytes.
and GNU find extrapolated from there. It probably seemed to be a good
idea then. :-(
> Not sure if there are any practical purposes for this behaviour.
> Treating the letters as multiplicative shortcuts would be more useful to
> me.
> But I guess for compatibility reasons this cannot be changed.
[...]
Exactly.
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'
--- End Message ---