Alvin escribió:
> MacArthur, Ian (SELEX GALILEO, UK) wrote:
> 
>>> FL_PATH_MAX, in filename.H, is defined to be 256. Any
>>> particular reason for
>>> 256? Was it an arbitrary choice or is there some background
>>> information
>>> that dictated 256?
>> I don't know. I suspect it's just "long enough", but still small enough
>> to be shorter than the real PATH_MAX on most (all?) systems...?
>>
>> I wonder if there's a reason not to have autoconf fill in a value, or
>> find something sensible from the system headers...?
> 
> Thanks.
> 
> I'm doing some file path manipulation and want to do some of the work with a
> buffer on the stack. I figured that since I already use the fl_filename_()
> routines, I would use FL_PATH_MAX as the size of my buffer. The only case I
> can see my code exceeding the buffer (255+1) is in the very unlikely case
> where it is acting on a heavily, heavily nested file. Not really an issue
> for me, I was just curious. :)
> 
> As for setting based on the OS, that would seem like a better cross-platform
> solution to me. 
> 

You are using fltk1.x? , because fltk2 from svn at least, have MAX_PATH 
as 1024.
Anyway, the max file size name for most of the filesystems is 255, so 
maybe it was defined for that in the code. The mistake is that one thing 
is the path of the file that may be very large in somes case's for 
example [dir 240chars]/[subdir 250chars]/[filename 253chars].txt .
So , in conclusion, 256 should be MAX_FILE_NAME not MAX_PATH :)
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to