tags:

views:

45

answers:

3

Hi

I have found out that you can't open(filepath) when filepath length is bigger that 255 even if the filename itself is 10 characters long( the remaining part is the directory path).

Any idea to work around this issue? (python 2.6 on win32)

A: 

Change directories one-by-one untill you get there :-)

BarsMonster
A: 

A Windows OS level solution is to use the DOS SUBST command to define a pseudo drive at a particular directory.

SUBST Q: C:\really\long\path\name\full\of\sub\directories

Then you can access the files in that directory as Q:filename.

Paul McGuire
+4  A: 

The most general approach to this is to prefix the path with "\\?\" (reference). Be aware that this disables certain pre-processing on the path, but nothing major IMO.

Luke