Actually, if all you're looking for is the maximum valid filename
length in a particular file system, why not just write a simple routine
that writes out a test file with an extremely large (>256) filename,
and then see how long a filename you can read back in?
This works on my regular and msdos partitions; I don't have an
extfs partition to check it for. It does also work on my Apollo DN-10000
at work, though.
================================Cut here===========================
#include <stdio.h>
#include <sys/errno.h>
int getfilenamelen() {
char name[1025];
register i;
FILE *file;
for( i = 0 ; i < 1024 ; i++) name[i] = 'a';
name[1024] = 0;
for( i = 0 ; i < 1023 ; i++) {
file = fopen( &(name[i]), "w" );
if (!file && errno != ENAMETOOLONG && errno != ENOENT ) {
perror( "getfilenamelen" );
return -1; /* Error return */
}
if (file) break;
}
fclose(file);
for( ; i < 1023 ; i++) {
file = fopen( &(name[i]), "r" );
if (!file) break;
fclose(file);
}
unlink( &(name[i]) );
return 1025-i;
}
main() {
printf("Filename len is %d\n", getfilenamelen());
exit(1);
}
===============================Cut here===========================
--Harold
--
"Twas brillig and the slithy toves I'm Harold R. Zatz, a.k.a. "H".
Did gyre and gimble in the wabe; Internet: hzatz@graphics.cornell.edu
All mimsy were the borogoves, USmail: 232 Linden Ave. Apt. #2
And the mome raths, outgrabe..." Ithaca, NY 14850
| Klaus S. Madsen | Regression in 2.6.25-rc3: s2ram segfaults before suspending |
| Dan Hecht | Re: + stupid-hack-to-make-mainline-build.patch added to -mm tree |
| Balbir Singh | Re: 2.6.23-rc7-mm1 - 'touch' command causes Oops. |
| Arjan van de Ven | [patch] Add basic sanity checks to the syscall execution patch |
git: | |
| Nicolas Pitre | Re: [PATCH] diff-delta: produce optimal pack data |
| Catalin Marinas | Re: hgmq vs. StGIT |
| Mark Levedahl | [PATCH] git-clone - Set remotes.origin config variable |
| Junio C Hamano | Re: tracking repository |
| Richard Daemon | Re: booting openbsd on eee without cd-rom |
| Matt | Setting up a virtual hosting machine w. SSH/SFTP accounts - pitfalls/experiences? |
| Paul Greidanus | [Fwd: Open-Hardware] |
| GVG GVG | ssh_exchange_identification: Connection closed by remote host |
| Jim Winstead Jr. | Re: Root Disk/Book Disk Compatibility |
| Paul Douglas Page | Where is mkfs? |
| Howard Wei-Hao Pan | [Q] Does Linux work with PCMCIA devices? |
| Timothy L. Kay | Use PERL rather than C for system commands? |
