1. Re: Error: file name for OPEN is too long
- Posted by Matt Lewis <matthewwalkerlewis at gma?l.co?> Dec 19, 2007
- 482 views
Juergen Luethje wrote: > > > So concerning full path names on FAT32, Eu's open() function will not > work with legitimate lengths of 255 to 259 characters. Although it might > be somewhat unlikely to encounter this problem, i can happen (as it did > to me). So maybe a future version of Eu can support the maximum allowed > length of 259 characters? Yes, this should probably be addressed. And we should also investigate this issue for other platforms, since they probably have different constraints. > Since Windows has the API function GetShortPathName for converting long > path and file names into short ones, I think I'll also try something > like this: > }}} <eucode> > if length(name) > 254 then > name = GetShortPathName(name) > end if > fn = open(name, "r") > </eucode> {{{ I think it shares the same limitations. From: GetShortPathName Function http://msdn2.microsoft.com/en-us/library/aa364989.aspx lpszLongPath The path string. The function retrieves the short form of this path. In the ANSI version of this function, the name is limited to MAX_PATH characters. To extend this limit to 32,767 wide characters, call the Unicode version of the function and prepend "\\?\" to the path. For more information, see Naming a File.