delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/01/23/19:06:55

From: bruceh AT ns1 DOT ieighty DOT net (Bruce N. Hunsaker)
Subject: (none)
23 Jan 1998 19:06:55 -0800 :
Message-ID: <199801220415.VAA32246.cygnus.gnu-win32@ns1.ieighty.net>
To: gnu-win32 AT cygnus DOT com

I have searched the archives but haven't seen this one
reported yet (but I might have missed it).

du reports sizes in 2k blocks.  It should report sizes using
a block size of 1k.

Example:
	$ ls -l du.exe
	-rwxr-x-r-x   1 all    Everyone   22016 May 08 1997 du.exe
	$ du du.exe
	11  du.exe

The correct output of du should be:
	22  du.exe

Looking at the source I changed 2 lines of code to fix this problem.
Change the line that says:
	size =ST_NBLOCKS(stat_buf)
to
	size =(stat_buf.st_size + 511) / 512;
I wonder what's wrong the the ST_NBLOCKS macro?
Second change:
	convert_blocks( size, output_size == kilobytes)
to
	convert_blocks( size, output_size)
This looks like a bug in the code, and might be fixed if there is a
newer version of GNU fileutils.

Also, performance is quite bad.  It is better with the patched
cygwin.dll in coolview, but du should still be much faster. (See
similar problems with find and ls...)


---
Bruce Hunsaker - bruceh AT ieighty DOT net

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019