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]

df and ls for root directories on Win9X


On Win9X, ls reports incorrect date and size (aliasing 
with those from a file) for Windows filesystem root dirs.  

~: ls -ld /c /c/MSDOS.SYS 
drwxr-xr-x   12 pierre   unknown      1660 Jul 18  2001 /c/
-r--r--r--    1 pierre   unknown      1660 Jul 18  2001 /c/MSDOS.SYS

Also UNC pathnames of root directories cannot be stat. 

~: ls -ld //hpn5170x/c //hpn5170x/c/msdos.sys
ls: //hpn5170x/c: No such file or directory
-r--r--r--    1 pierre   unknown      1660 Jul 18  2001 //hpn5170x/c/msdos.sys

Both problems stem from incorrect use of FindFirstFile
(FindFirstFile(c:\*) does not return a handle to c:\ )

Also df is known to be broken for disks > 2 GB. A patch has been
submitted long ago, but was never completed:
<http://cygwin.com/ml/cygwin-patches/2001-q1/msg00183.html>
I have been in touch with the author, without looking at his patch.
He told me that he never got someone to sign the release.
I thus wrote a new patch from scratch.

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.

Attachment: ls_df.diff
Description: Text document


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