That is a very good idea. POSIX has functions
long pathconf(const char *path, int name);
long fpathconf(int fildes, int name);
The problem is it is not very easy to know how long the filename can be.
I wish stat could give me some info. Only thing I can think of now is
1. create a file with very long filename (300 chars)
2. find out how many chars are valid.
3. delete the file and return that number.
But, I think that is not very nice.
--
H.J.
Gcc/libc maintainer for Linux.
In article <Aug.2.15.20.25.1992.25614@dumas.rutgers.edu>, hedrick@dumas.rutgers.edu (Charles Hedrick) writes:
|> I think it probably is a good idea to supply a way to find the maximum
|> file name size on a file system. For most programs it doesn't matter,
|> but programs that tack on a suffix would like to make sure that the
|> new name is really different from the old. Otherwise foo~ or foo.Z
|> overwrite foo, This is an issue that SVr4 also has to deal with, since
|> they also have multiple file types, both sys5 -- with short names, and
|> ufs -- with long names. Why not do it compatibly? Implement statvfs.
|> One of the fields it returns is f_namemax, the maximum file name size
|> for the file system.
| Andrew Morton | Re: 2.6.24-rc6-mm1 |
| Glauber de Oliveira Costa | [PATCH 8/19] modify write_ldt function |
| Steven Rostedt | Re: Major regression on hackbench with SLUB |
| Satyam Sharma | Re: 2.6.23-rc4-mm1 |
git: | |
| Chris Ortman | [FEATURE REQUEST] git-svn format-patch |
| Bill Lear | Meaning of "fatal: protocol error: bad line length character"? |
| Scott Chacon | Git Community Book |
| Catalin Marinas | Re: [ANNOUNCE] pg - A patch porcelain for GIT |
| Richard Stallman | Real men don't attack straw men |
| frantisek holop | nptd regression in 4.2 |
| Kevin | uvm_mapent_alloc: out of static map entries on 4.3 i386 |
| Vim Visual | GRAPE cluster supercomputer + OpenBSD |
| John Stoffel | Re: [PATCH] LogFS take three |
| hooanon05 | [PATCH 62/67] aufs magic sysrq handler |
| Chris Mason | Re: [PATCH][RFC] fast file mapping for loop |
| Chris Mason | Re: [ANNOUNCE] Btrfs v0.12 released |
