Page 1 of 1

max length of drive+path+filename that pb can handle ?

Posted: Fri Jul 22, 2011 6:32 am
by sartic
C:\Documents and Settings\Spalato\My documents\Prijam\Irena-radovi\Irena -radovi(D)\ILO\Asbestosis, pleural plaques and diffuse pleural thickening three distinct benign responses to asbestos exposure -- Gevenois et al_ 11 (5) 1021 -- European Respiratory Journal.mht

Example has 266 and do not work.
Question what is max length that works? 255? 256? Width or widthout C:\ in this example.
Is number same for NTFS and FAT32 or FAT32 has lower number?

Re: max length of drive+path+filename that pb can handle ?

Posted: Fri Jul 22, 2011 6:47 am
by eesau
On Windows the length is defined by the #MAX_PATH constant.

Re: max length of drive+path+filename that pb can handle ?

Posted: Fri Jul 22, 2011 7:04 am
by sartic
Thx! It has value 260. Even that is long for my program now...
Have to add this check before opening this files.
ISO9660 has max 219 on level X, so my max will be 219+len(drive).

Re: max length of drive+path+filename that pb can handle ?

Posted: Fri Jul 22, 2011 8:16 am
by djes

Re: max length of drive+path+filename that pb can handle ?

Posted: Fri Jul 22, 2011 1:37 pm
by sartic
Page Not Found

Do u have something 2 add ?

Re: max length of drive+path+filename that pb can handle ?

Posted: Fri Jul 22, 2011 1:42 pm
by eesau
This should work. For some reason the forum breaks some links.

Re: max length of drive+path+filename that pb can handle ?

Posted: Fri Jul 22, 2011 2:02 pm
by djes
Thank you :)

Re: max length of drive+path+filename that pb can handle ?

Posted: Mon Jul 25, 2011 4:02 pm
by sartic
Thx man. I have also problem reading files width names that has ascii chars over 127. Some works some not (maybe unicode doesn't work).

Re: max length of drive+path+filename that pb can handle ?

Posted: Mon Aug 15, 2011 3:00 pm
by blueznl
Unicode, double byte code and what not may cause considerable confusion. Even though Windows XP and later are unicode aware, they still sometimes screw up. For example a chinese version of windows can create filenames that I cannot delete from an english version. Strangely enough, I cannot delete those files, but I can rename them, so I first have to rename them before I can delete them.

This happens from within the Windows explorer as well as from within Total Commander. Dunno if it is a Windows limitation, or if the programmers of Total Commander and Windows Explorer made the same mistake :-)

As for max path length, the length is the number of characters including terminating null (so it's actually 259 characters, not 260 :-))

But... under Unicode they may be much longer using the \\?\ notation. However, there's a lot of software out there that does not support that... including large parts of Windows itself :shock: