This is the mail archive of the cygwin 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: default PATH


On 10 February 2006 19:01, Corinna Vinschen wrote:

> On Feb  8 18:59, Dave Korn wrote:

>> 
>> Since POSIX semantics requires an empty path component to be treated as
>> $CWD, but Win32 semantics require an empty path component to be ignored,
>             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> How do you know that?  Can you give me a pointer describing that?  I
> searched MSDN and KB and found not a word about how multiple semicolons
> are treated by Win32 functions or cmd/command.  This is tricky to test
> since, for instance, CreateProcess searches the current directory anyway
> before using %PATH% (see MSDN).

  You're right; it doesn't seem to be documented anywhere I can find.  I may
be remembering something from way back in DOS days.

  However, it is /in fact/ the case that empty path components are ignored,
rather than treated as meaning "current dir":

Microsoft Windows 2000 [Version 5.00.2195]
(C) Copyright 1985-2000 Microsoft Corp.

G:\>mkdir foo

G:\>mkdir bar

G:\>path
G:\windows\system32;G:\windows;G:\foo;G:\bar;G:\nonexistent;G:\foo;G:\f
oo;;G:\bar;G:\bar;;;;;G:\nonexistent;G:\nonexistent;;;;;;;G:\nonexistent;G:\fo
o;
G:\bar

G:\>unfoundfilename.exe
'unfoundfilename.exe' is not recognized as an internal or external command,
operable program or batch file.

G:\>path
G:\windows\system32;G:\windows;G:\foo;G:\bar;G:\nonexistent;G:\foo;G:\f
oo;;G:\bar;G:\bar;;;;;G:\nonexistent;G:\nonexistent;;;;;;;G:\nonexistent;G:\fo
o;
G:\bar;.;G:\bar;.;G:\foo;;G:\foo

G:\>unfoundfilename2.exe
'unfoundfilename2.exe' is not recognized as an internal or external command,
operable program or batch file.

G:\>

..as the attached Filemon logs show, all the path components are tested,
including the nonexistent ones, but nothing at all is done for the empty path
components.


    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....

Attachment: Filemon.LOG
Description: Binary data

Attachment: Filemon2.LOG
Description: Binary data

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

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