This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
find misreports file size when using %b, %k
- From: Jeremy Hetzler <jeremyhetzler at earthlink dot net>
- To: cygwin at cygwin dot com
- Date: Fri, 30 Aug 2002 22:13:47 -0700
- Subject: find misreports file size when using %b, %k
The "find -printf" escapes %b and %k should return filesize in 512-byte
blocks and in 1k blocks, respectively. Instead, %b returns size in 1k
blocks, and %k returns size in 2k blocks; i.e. the values are half those
expected. %s, filesize in bytes, works correctly. Is this standard
behavior, or Patches Gratefully Accepted? (Win2k, NTFS, Cygwin ver 1.3.12-4)
$ dd if=/dev/null of=foo bs=1024 count=0 seek=1000
0+0 records in
0+0 records out
$ ls -la foo
-rw-r--r-- 1 steveb None 1024000 Aug 30 22:03 foo
$ du -sk foo
1000 foo
$ find -name "foo" -printf "%s %b %k"
1024000 1000 500
$ find --version
GNU find version 4.1.7
From find.info:
Size Directives
...............
`%k'
File's size in 1K blocks (rounded up).
`%b'
File's size in 512-byte blocks (rounded up).
`%s'
File's size in bytes.
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/