This is the mail archive of the cygwin-patches@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: df and ls for root directories on Win9X


On Sun, May 25, 2003 at 05:54:32PM -0400, Pierre A. Humblet wrote:
>At 12:48 PM 5/25/2003 -0400, Christopher Faylor wrote:
>>On Sun, May 25, 2003 at 11:19:01AM +0200, Corinna Vinschen wrote:
>>>On Fri, May 23, 2003 at 06:34:23PM -0400, Pierre A. Humblet wrote:
>>>> 2003-05-23  Pierre Humblet  <pierre.humblet@ieee.org>
>>>> 
>>>> 	* autoload.cc (GetDiskFreeSpaceEx): Add.
>>>> 	* syscalls.cc (statfs): Call full_path.root_dir() instead of
>>>> 	rootdir(full_path). Use GetDiskFreeSpaceEx when available and
>>>> 	report space available in addition to free space.
>>>> 	* fhandler_disk_file.cc (fhandler_disk_file::fstat_by_name):
>>>> 	Do not call FindFirstFile for disk root directories.
>>>
>>>Applied.
>>
>>Um.  I am still reviewing the fstat_by_name stuff.  I will be making
>>changes to this.
>>
>I hope you find a more elegant way to determine when it's a root directory.

The previous code obviously went out of its way to handle a special
case.  It was not a "bug" that it filled out an array and changed "c:\"
to "c:\*".

I'm away from my computer now so I can't easily check to see what you
did but it looks like you made the root directory always assume today's
date.

I also had a problem with this:
+  else if (pc->isdir () && strlen (*pc) <= strlen (pc->root_dir ()))

Isn't the strlen check just a more expensive and less clear way of doing
a strcmp?  i.e.,

+  else if (pc->isdir () && strcmp (*pc, pc->root_dir () == 0)

?

cgf


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]