On Wed, 14 Mar 2001 at 2:48pm (-0800), Rob Hardowa wrote:
> Hey all,
>
> A friend just asked me a q I could not provide an answer for. They are
> doing a large project in which they assume the directory structure will
> be quite vast (deep) and would like to know if there is a limit to that
> depth. I am presuming it's an ext2fs (possibly reiserfs?). Does anyone
> know if such a limit is imposed?
Hello Rob,
there are a few limits that might come into play. No indivitual
file name can be longer than 255 characters. No path name can be longer
than 4095 characters. In theory this means you can can go 2048 directories
deep if you use filenames of 1 characters. But - the 4095 limit just
applies to the path name as references. You can make directories deeper
than 2048 if you use relative paths but you might have a hard time getting
at them with some programs (like your shell.) These are kernel limites so
they should be independent of filesytem type. From
/use/include/linux/limits.h...
#define NAME_MAX 255 /* # chars in a file name */
#define PATH_MAX 4095 /* # chars in a path name */
Some fun commands to try (with care)...
Make overly-deep directores. Will run until interupted:
perl -e '$cnt = 1; $dir = "A"; while (1){mkdir($dir, 0000) || die "$!:
$cnt"; chdir($dir); print "$cnt\n"; $cnt++}'
Make deepest possible absolute path. Will terminate at 2048.
perl -e '$cnt = 1; $dir = "/A"; while (1){mkdir($dir, 0000) || die "$!:
$cnt"; print "$cnt\n"; $cnt++; $dir .= "/A"}'
Make longest possible single directory name. Will terminate at 256.
perl -e '$cnt = 1; $dir = "/A"; while (1){mkdir($dir, 0000) || die "$!:
$cnt"; print "$cnt\n"; $cnt++; $dir .= "A"}'
M.
--
WebCentral Pty Ltd Australia's #1 Internet Web Hosting Company
Level 1, 96 Lytton Road. Network Operations - Systems Engineer
PO Box 4169, East Brisbane. phone: +61 7 3249 2557
Queensland, Australia. pgp key id: 0x900E515F
_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list