This is the mail archive of the
mailing list for the Cygwin project.
Re: Using du.exe to calculate disk usage on a Microsoft cluster server
- From: Linda Walsh <cygwin at tlinx dot org>
- To: cygwin at cygwin dot com
- Date: Fri, 07 Jul 2006 14:07:14 -0700
- Subject: Re: Using du.exe to calculate disk usage on a Microsoft cluster server
- References: <00ec01c6a1dd$ab40c1b0$a501a8c0@CAM.ARTIMI.COM>
Dave Korn wrote:
Still lacking in useful information. You *still* haven't told us HOW on
earth you managed to get impossibly long file names, you *still* haven't shown
us the names of any directories that have failed.
It is quite trivial. He's prepending either "S:/" or
"/cygdrive/s" to an existing pathname. The existing pathname can be at the
limit (~256 bytes). Adding either prefix, above, the pathlen becomes 259 or
267 bytes, respectively.
Another easy way: cd to directory "/averylongdirnamethathas200chars"
you can create a file in that directory of "maxchars", but when you try
to reference that file from anywhere other than the directory in which it is
located, you'll overflow the pathlen buffer.
The answer is the same as before, since you have supplied none of the
further information which would have allowed a more detailed answer. You
might try using a mountpoint to shorten some of the prefix of the overly long
filenames. I *still* don't understand how it is possible for your users to
create files with names that are longer than the maximum filename length that
windows permits - this is a limitation of the windows OS and filing system,
not one that cygwin imposes.
A workaround might be using "Find" to find the directories, and execute
the "du -s *" in each directory, and pipe the output through a filter that
does a final concatenation of the current dir + pathname.
2. Has anyone else found a solution which will properly report the
amount of disk space a particular directory is occupying?
I don't think "du" will return the correct value for actual directories.
In other words, on linux, "mkdir t; touch t/a t/b t/c ... t/z" will create
a directory that takes up 4k, but on Windows it still claims it is taking 0k.
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html