This is the mail archive of the cygwin-developers@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: /cygdrive improvements

[Get raw message]
On Thu, Nov 22, 2001 at 01:06:43AM -0500, Christopher Faylor wrote:
> I've just made some changes to cygwin.
> 
> I've added opendir, readdir, telldir, etc.  methods to the fhandler
> class.
> 
> I also implemented /cygdrive as a special "device" in cygwin.  Cygdrive
> inherits most of its methods from fhandler_disk_file except for the opendir
> ones.
> 
> I've implemented the directory handling methods for cygdrive so that you
> can now do this:
> 
>     % ls /cygdrive
>     a   c  d  e
> 
> This allows completion in shells like zsh.
> 
> The only thing wrong with this currently is that zsh times out trying to
> read the floppy drive the first time.

It does on empty CD-ROMs and any kind of removable media drives, too.
That is, three times the "no media" message on my XP box.  I like this
/cygdrive patch but I think we should avoid these messages.  I'm breaking
out in a sweat thinking of the funny postings in the cygwin mailing list.
I have no solution currently (I haven't even tried to find one, FWIW)
but I will look for one.

Anyway, there's actually a tiny bug in path.cc, path_conv::check().
I found that I couldn't use the applications in my Windows system
folder anymore.  These are accessed through /cygdrive/e/WINXP/... path:

~ $ ping cygwin.com
ping: Command not found.

But then, the surprise:

~ $ ping.exe cygwin.com

Pinging cygwin.com [209.249.29.67] with 32 bytes of data:

Reply from 209.249.29.67: bytes=32 time=315ms TTL=245
[...]

I had a look into path.cc and found that the whole symlink code is
short circuted if the device number returned by conv_to_win32_path()
is FH_CYGDRIVE.

The following patch seems to solve that problem but... is it correct?

Corinna

	* path.cc (path_conv::check): Don't return immediately if path
	is a cygdrive path.

Index: path.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/path.cc,v
retrieving revision 1.186
diff -u -p -r1.186 path.cc
--- path.cc	2001/11/24 03:35:58	1.186
+++ path.cc	2001/11/24 20:11:44
@@ -493,9 +493,8 @@ path_conv::check (const char *src, unsig
 		      return;
 		    }
 		  fileattr = 0;
+		  goto out;		/* Found a device.  Stop parsing. */
 		}
-
-	      goto out;		/* Found a device.  Stop parsing. */
 	    }
 
 	  update_fs_info (full_path);

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin@cygwin.com
Red Hat, Inc.


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