[fpc-devel] Re: FindFile / FindNext does work with > 253 character length files

Michael Van Canneyt michael at freepascal.org
Fri Mar 14 20:00:34 CET 2008



On Fri, 14 Mar 2008, Sergei Gorelkin wrote:

> Graeme Geldenhuys wrote:
> > >
> > >  Under Linux the maximum file length is 255 character. Gnome's Nautilus
> > >  allows that length. Any larger and Nautilus or a terminal command like
> > >  'cp' complains.
> > >
> > >  FindFile / FindNext however seems to have a 253 character limit!  Why
> > >  the difference when the OS can support up to 255 characters?
> 
> 
> I believe that this is caused by lack of careful testing. Some time ago I've
> found a similar-looking limitation in Windows commandline handling and posted
> a patch (Mantis #10175).
> Btw, strange to hear about 255 character limit on Linux. Its headers define
> MAX_PATH value as 4097.

Nono, TSearchRec only contains the filename; MAX_PATH is the length of a full path,
the maximum length of a filename is not 4079.  

Michael.



More information about the fpc-devel mailing list