Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > RE: file names longer than MAX_PATH under Windows 2003

Reply
Thread Tools

RE: file names longer than MAX_PATH under Windows 2003

 
 
Tim Golden
Guest
Posts: n/a
 
      02-14-2006
[Sergey]

| "Tim Golden" <(E-Mail Removed)> wrote in
| message news:(E-Mail Removed)...
| [Sergey]
|
| >Not to state the obvious, but can you cut-and-paste that long
| >string (the one starting with \\?\e:\...) from the Python
| >interpreter into the [S]tart [R]un [O]pen field to see what
| >comes up? I'm just trying to make sure of the most straightforward
| >fact: that the file you've got there definitely does exist!
|
| I cannot do this: when I paste filename there, trail of
| filename is missing due to length limit in input line.
| But I strongly suppose that file exists as its name was get
| through os.listdir.

I see from another post that CreateFile cannot open your file.
That puts it further away from Python, although it doesn't
explain how some other program can see the files. Can you use
os.startfile (or its equivalent win32api.ShellExecute from
pywin32)? Perhaps if you were to chdir to the directory in
question you'd be able to access the file.

Don't know really; clutching at straws.

TJG

__________________________________________________ ______________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
__________________________________________________ ______________________
 
Reply With Quote
 
 
 
 
Sergey
Guest
Posts: n/a
 
      02-15-2006

"Tim Golden" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
[Sergey]

>I see from another post that CreateFile cannot open your file.
>That puts it further away from Python, although it doesn't
>explain how some other program can see the files. Can you use
>os.startfile (or its equivalent win32api.ShellExecute from
>pywin32)? Perhaps if you were to chdir to the directory in
>question you'd be able to access the file.


I found error in filename (extra backslash) and now I can open file.
But another trouble appeared: I cannot listdir so long name.
I examined posixmodule.c... There are wcsncpy with hard limit of MAX_PATH*2+5.
So... RIP, my module...


 
Reply With Quote
 
 
 
 
Claudio Grondi
Guest
Posts: n/a
 
      02-15-2006
Sergey wrote:
> "Tim Golden" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
> [Sergey]
>
>
>>I see from another post that CreateFile cannot open your file.
>>That puts it further away from Python, although it doesn't
>>explain how some other program can see the files. Can you use
>>os.startfile (or its equivalent win32api.ShellExecute from
>>pywin32)? Perhaps if you were to chdir to the directory in
>>question you'd be able to access the file.

>
>
> I found error in filename (extra backslash) and now I can open file.
> But another trouble appeared: I cannot listdir so long name.
> I examined posixmodule.c... There are wcsncpy with hard limit of MAX_PATH*2+5.
> So... RIP, my module...
>
>

I don't know if and how it apply and can be of any help here, but in my
C programs in the very past after switching from DOS to Windows long
names a following trick solved often my problems with too long names:
step 1: setting the current directory to the beginning part of the
name with a length which can be passed as a function parameter
step 2: usage of the remaining part of name as name passed as
parameter to the file accessing function (relative to current directory)

Claudio
 
Reply With Quote
 
Sergey
Guest
Posts: n/a
 
      02-15-2006

"Claudio Grondi" <(E-Mail Removed)> wrote in message news:dsvims$gps$(E-Mail Removed)...
> Sergey wrote:
> I don't know if and how it apply and can be of any help here, but in my C programs in the very past after switching from DOS to
> Windows long names a following trick solved often my problems with too long names:
> step 1: setting the current directory to the beginning part of the name with a length which can be passed as a function
> parameter
> step 2: usage of the remaining part of name as name passed as parameter to the file accessing function (relative to current
> directory)


It seems this method doesn't help here.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change MAX_PATH value? sonet Perl Misc 2 12-04-2007 11:36 PM
RE: file names longer than MAX_PATH under Windows 2003 Tim Golden Python 2 02-15-2006 07:40 PM
RE: file names longer than MAX_PATH under Windows 2003 Tim Golden Python 2 02-14-2006 12:17 PM
file names longer than MAX_PATH under Windows 2003 Sergey Python 4 02-14-2006 12:12 PM
Does ANSI C have something like PATHMAX or MAX_PATH? Sunner Sun C Programming 23 04-13-2004 01:19 PM



Advertisments