delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2002/12/15/18:50:36

From: sandmann AT clio DOT rice DOT edu (Charles Sandmann)
Message-Id: <10212152352.AA21607@clio.rice.edu>
Subject: Re: proposed putpath.c patch
To: djgpp-workers AT delorie DOT com
Date: Sun, 15 Dec 2002 17:52:36 -0600 (CST)
In-Reply-To: <3791-Fri13Dec2002105929+0200-eliz@is.elta.co.il> from "Eli Zaretskii" at Dec 13, 2002 10:59:30 AM
X-Mailer: ELM [version 2.5 PL2]
Mime-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

I decided any effort to optimize this (caching) to speed up /dev was
time wasted for people who violate the rules of using /dev ...
I updated the copyright, but that's not worth repeating the original patch.

At the bottom is my diffs for the _put_path documentation.  Comments?

> > This patch makes the /dev directory work for me in most cases.

Eli responded:

> I have some concerns about this (but I'm not sure they are grave
> enough to object to the change):
> 
>  - this makes _putpath rather slow for Unix-style device names

I documented this in the attached diff

>  - if /dev exists and we are on W2K/XP, won't this break DOS devices
>    such as /dev/LPT1 ?  I seem to recall those systems have problems
>    with creating the illusion any device exists in any directory.

In the testing I've done on Win98 and Win2K I haven't seen any
problems, but I added cautions in the documentation anyway.

The only place I find /dev/DOS_device documented is in the _put_path
documentation, so it's use is probably rare (I haven't found an 
example of it anywhere).  We also tell people to not use \dev 
directories (but it happens).

>  - doesn't function 43h have problems on W2K/XP?

No - it was the ioctl calls for handles.


*** putpath.tx_	Wed May 12 04:36:52 1999
--- putpath.txh	Sun Dec 15 17:22:44 2002
*************** scripts.
*** 56,64 ****
  Any file name which begins with @file{/dev/} or @file{@var{x:}/dev/}
  (where @var{x:} is any valid DOS drive letter) has the @file{/dev/} or
! @file{@var{x:}/dev/} prefix removed, and the rest is passed to DOS.
  This is because some DOS functions don't recognize device names unless
  they are devoid of the drive and directory specifications, and programs
  could add a drive and a directory if they convert a name like
  @file{/dev/con} to a fully-qualified path name.
  
  @item @file{/dev/x/} is translated into @file{x:/}.
--- 56,70 ----
  Any file name which begins with @file{/dev/} or @file{@var{x:}/dev/}
  (where @var{x:} is any valid DOS drive letter) has the @file{/dev/} or
! @file{@var{x:}/dev/} prefix removed (if the @file{/dev/} directory does
! not exist), and the rest is passed to DOS.
  This is because some DOS functions don't recognize device names unless
  they are devoid of the drive and directory specifications, and programs
  could add a drive and a directory if they convert a name like
  @file{/dev/con} to a fully-qualified path name.
+ Because of the different behavior when the @file{/dev/} directory
+ exists, you should only add the prefix @file{/dev/} to your DOS device 
+ names if necessary and be sure that the @file{/dev/} does not exist.
+ Due to the additional overhead of checking if @file{/dev/} exists, 
+ functions working with DOS device names with the prefix will be slower.
  
  @item @file{/dev/x/} is translated into @file{x:/}.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019