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

Windows specific forum
sartic
Enthusiast
Enthusiast
Posts: 143
Joined: Thu Aug 26, 2010 8:26 am

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

Post 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?
Registered user of PB (on Linux Mint 21.1 & Win 10 64bit)
eesau
Enthusiast
Enthusiast
Posts: 589
Joined: Fri Apr 27, 2007 12:38 pm
Location: Finland

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

Post by eesau »

On Windows the length is defined by the #MAX_PATH constant.
sartic
Enthusiast
Enthusiast
Posts: 143
Joined: Thu Aug 26, 2010 8:26 am

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

Post 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).
Registered user of PB (on Linux Mint 21.1 & Win 10 64bit)
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

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

Post by djes »

Last edited by djes on Fri Jul 22, 2011 2:01 pm, edited 2 times in total.
sartic
Enthusiast
Enthusiast
Posts: 143
Joined: Thu Aug 26, 2010 8:26 am

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

Post by sartic »

Page Not Found

Do u have something 2 add ?
Registered user of PB (on Linux Mint 21.1 & Win 10 64bit)
eesau
Enthusiast
Enthusiast
Posts: 589
Joined: Fri Apr 27, 2007 12:38 pm
Location: Finland

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

Post by eesau »

This should work. For some reason the forum breaks some links.
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

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

Post by djes »

Thank you :)
sartic
Enthusiast
Enthusiast
Posts: 143
Joined: Thu Aug 26, 2010 8:26 am

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

Post 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).
Registered user of PB (on Linux Mint 21.1 & Win 10 64bit)
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6172
Joined: Sat May 17, 2003 11:31 am
Contact:

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

Post 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:
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Post Reply