From: earnie_boyd AT hotmail DOT com (Earnie Boyd) Subject: Re: du bug, wrong sizes reported. 24 Jan 1998 17:31:29 -0800 Message-ID: <19980123142441.18134.qmail.cygnus.gnu-win32@hotmail.com> Content-Type: text/plain To: bruceh AT ns1 DOT ieighty DOT net Cc: gnu-win32 AT cygnus DOT com >From: "Bruce N. Hunsaker" >Subject: du bug, wrong sizes reported. >To: gnu-win32 AT cygnus DOT com >Date: Tue, 20 Jan 1998 11:59:01 -0700 (MST) > >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. No. The default block size should be 512 bytes. > >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 This should be 44 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 The -h switch works though without source modification. The -k switch produces the same results as the command with no switch. - \\||// ---o0O0--Earnie--0O0o---- -earnie_boyd AT hotmail DOT com- ------ooo0O--O0ooo------- Check out these great gnu-win32 related sites: ftp://ftp.cygnus.com/pub/gnu-win32/latest/ (ftp site) http://www.cygnus.com/pubs/gnupro/ (Comercial Page) http://www.cygnus.com/misc/gnu-win32/ (Project Page) http://www.cygnus.com/ml/gnu-win32 (Mail Archives) http://www.itribe.net/virtunix/winhelp-man-pages/ (HTML Man Pages) http://www.lexa.ru/sos (Sergey Okhapkin) ftp://www.lexa.ru/pub/domestic/sos/ (Sergey's ftp site) http://www.fu.is.saga-u.ac.jp/~colin/gcc.html (Colin Peters) http://www.xraylith.wisc.edu/~khan/software/gnu-win32/ (Mumit Khan) http://gnu-win32.paranoia.ru (Chuck Bogorad's ports) ftp://ftp.deninc.com/pub (Den Internet Services - US mirror and ports) http://www.bestweb.net/~aka/gnu-win32/ (GNU-Win32 Bash Configuration) ______________________________________________________ Get Your Private, Free Email at http://www.hotmail.com - 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".