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 10/13/07, Corinna Vinschen wrote:
> On Oct 13 13:03, Corinna Vinschen wrote:
> > So, for now we have four options(*)what to do in exec(3) when trying to
> > start a native child process from a long CWD (> MAX_PATH):
> >
> > 1. Return ENAMETOOLONG and don't start the native child.
> >
> > 2. CWD for the native child is set to $SYSTEMROOT.
> >
> > 3. CWD is set to the root of the current drive (either X:\ or
> >    \\server\share).
> >
> > 4. CWD is set to the longest leading path component of CWD which still
> >    fits into MAX_PATH.
>
> I forgot the fifth option, suggested by Pierre:
>
> 5. Start the native app in the last CWD we were in which was < MAX_PATH.
>
> > As an additional possible feature, regardless of which of the above
> > options we choose:
> >
> > - Print a longish message along the lines of what's printed by CMD.

I have another idea. Don't know how well it would work, but something
to consider. How about:

6. Set current directory to "C:\obviouslynonexistantpath".

Then, if the win32 program tries to use the current directory it will
fail, as it should, and if it doesn't make use of the cwd, then there
will be no problem. I think that is what will happen -- I haven't
actually tested it :-)

Lev


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