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: Another long pathname question


On Thu, Feb 26, 2009 at 4:19 AM, Corinna Vinschen
<corinna-cygwin@cygwin.com> wrote:
> On Feb 25 18:58, Greg Freemyer wrote:
>> I just read the release email for 1.7.0
>>
>> In part it says:
>>
>> - Fallout from the long path names: If the current working directory is
>> ? longer than 260 bytes, or if the current working directory is a virtual
>> ? path (like /proc, /cygdrive, //server), don't call native Win32 programs
>> ? since they don't understand these paths.
>>
>> I've done a fair amount of long path name testing in Vista / Win2008,
>> and I'd like to understand the above in more detail.
>
> It's a restriction of Win32 processes. ?The CWD is stored in the PEB
> (process environment block) of every process. ?It's stored as path as
> well as as handle. ?Unfortunately the CWD in the PEB is a static storage
> area of 520 bytes == 260 (MAX_PATH) wide characters. ?That's why no
> Win32 process can have a long path as CWD. ?See also
> http://msdn.microsoft.com/en-us/library/aa365530(VS.85).aspx
>
>
> Corinna

I just created a long path with long individual directory names and
placed junk.txt in it both at one of the upper directories, and way
down at the bottom.

Then I used file explorer to open both via notepad.  Using task
manager I can see the full invocation arguments (view enables the
command line field).

If the path is short, it uses the full long directory name as
expected.  If the path exceeds 260, it reverts to using the 8.3 names,
thus giving a workaround that will allow you to descend deeper into a
directory structure.

Interesting trick.  Maybe you should consider something similar for cygwin.

Greg
-- 
Greg Freemyer
Litigation Triage Solutions Specialist
http://www.linkedin.com/in/gregfreemyer
First 99 Days Litigation White Paper -
http://www.norcrossgroup.com/forms/whitepapers/99%20Days%20whitepaper.pdf

The Norcross Group
The Intersection of Evidence & Technology
http://www.norcrossgroup.com

--
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]