This is the mail archive of the cygwin-developers 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: CWD and long paths


On Oct 12 11:54, Pierre A. Humblet wrote:
> | The problem is, the SetCurrentDirectory function can *not* handle long
> | path names and, generally spoken, Win32 can *not* handle current working
> | directories of more than MAX_PATH (260) characters.  The reason for this
> | restriction is the fact that the per-process environment block (PEB),
> | which is handled by the Win32 libraries, stores the CWD in a structure
> | like this:
> |
> |  struct  {
> |    WCHAR path[MAX_PATH];
> |    HANDLE hdl;
> |  }
> 
> If the pathname is given in short form (8.3), does Window expand it before storing it in 
> cwd.path?

I don't know, but I'm not really keen to convert paths into their 8.3
representation.  I'm also rather sure you can't fold all possible paths 
into a 8.3 form.

> Another possibility is to do what we currently do if the cwd is a virtual cygwin directory, such 
> as /proc
> At least that would be consistent and there have been no complaints AFAIK.
> One is not supposed to launch Windows program from a directory that the program can't 
> understand.

Which means, the native app ends up in the last CWD which could be
represented in MAX_PATH.  Hmm.  The implementation in cwdstuff would
be rather simple, afaics...


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat


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