[VM] non-MacRoman file names

David T. Lewis lewis at mail.msen.com
Thu Nov 27 02:41:03 UTC 2003


On Thu, Nov 27, 2003 at 12:28:26PM +1300, Richard A. O'Keefe wrote:
> 	Alas lots of assumptions/code that considers that 256 bytes is maximum  
> 	for a file/folder name. Somehow
> 	  I thought I was done, but now I've got possible VM changes and more  
> 	fiddling to do.
> 	
> In many versions of Unix the limit has been 1024 for a couple of decades.

I think that this is really an attibute of the file system, rather than the
operating system per se, but it might be reasonable to query the OS about its
assumptions.  On unix and/or posix flavored systems, maximum file length seems
to be given by FILENAME_MAX.

  #include <stdio.h>
  main() {printf("FILENAME_MAX is %d\n", FILENAME_MAX);}

In addition, various header files make reference to PATH_MAX and related
definitions (255 is a commonly used value). As near as I can tell, these are
not really constrained by the OS or by the file system, but are limits imposed
by various applications or compatibility libraries.

If I'm interpreting this correctly, you can think of a path as a string of
arbitrary length delimited by path separators ($/ for unix), with the only
hard limit being that of the FILENAME_MAX. Presumably the components
of a path string are themselves file names, each of length FILENAME_MAX
or less.

Other operating systems handle paths and folders quite differently, but
it may turn out that FILENAME_MAX is only thing worth asking the operating
system about, and the rest could be handled on the fly.

Dave




More information about the Squeak-dev mailing list