login
Header Space

 
 

Max characters in a filename

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
Date: Tuesday, August 4, 1992 - 5:35 pm

I'm not sure the answer to this question has come up, and I don't have
time to locate the original article.  

The question was, is there some way to determine what the maximum number
of characters in a file name is, in a particular file system?

According to the POSIX.1 standard, you would use:

#include <unistd.h>
long pathconf(const char *path, int name);
long fpathconf(int fildes, int name);

These two functions return values for path-dependent configuration
variables, at run-time.  "fpathconf" is for opened files.

For "name", substitute _PC_NAME_MAX.  The value returned for a path
which leads to a Minix file system should be 14, etc.

I'm not sure whether these functions are implemented in Linux, but they
would seem to be highly desirable in a POSIX implementation.  There are
lots of other neat "name" values for various path-dependent
configuration values....


Rob L.


 * Origin: Via the Annex in Victoria, TX (1:3802/217)
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Max characters in a filename, Rob Levin, (Tue Aug 4, 5:35 pm)
speck-geostationary