unix question: files per directory

Wm. Brian McCane news at brian386.UUCP
Thu Apr 27 14:47:28 AEST 1989


In article <776 at helios.toronto.edu> sysruth at helios.physics.utoronto.ca (Ruth Milner) writes:
>In article <4822 at macom1.UUCP> rikki at macom1.UUCP (R. L. Welsh) writes:
=>From article <24110 at beta.lanl.gov>, by dxxb at beta.lanl.gov (David W. Barts):
==> 
==> How many files can there be in a single UNIX directory
=>
=>You will undoubtedly run out of inodes before you reach any theoretical
=>limit.  
>
>Another thing you may run into is that some UNIX utilities seem to store
>the names of all of the files somewhere before they do anything with them,
>and if there are a lot of files in the directory, you won't be able to
>run the utility on all of them at once. (This won't prevent you from creating
>them, though). In particular I am thinking of "rm". When cleaning up after
>installing the NAG library, I tried to "rm *" in the source code directory.
>It refused (I think the error was "too many files"). I had to go through and 
>"rm a*", "rm b*" etc. until it was down to a level that rm would accept. I 
>
>Does anyone know:
>     1. why "rm" does it this way, and
>     2. are there other utilities similarly affected?
>
> Ruth Milner          UUCP - {uunet,pyramid}!utai!helios.physics!sysruth


You didn't actually run into a "rm" bug/feature, you hit a shell
FEECHER.  The shell expands for the regexp, and then passes the
generated list to the exec'd command as the arguments.  "rm" can only
handle a limited number of files, (or it may be the shell will only pass
a limited number, who knows, its a FEECHER after all ;-), so rm then
gave the error message of too many filenames.  I would like it if "rm"
were similar to most other commands, ie. you could rm "*", preventing
the expansion of the * to all file names until "rm" got it, but it
returns the message "rm: * non-existent" on my machine, Sys5r3.0.

	brian

(HMmmm.  That new version of "rm" I mentioned sounded kinda useful, I
wonder if anyone out there has 1 already?? HINT ;-)


-- 
Wm. Brian McCane                    | Life is full of doors that won't open
                                    | when you knock, equally spaced amid
Disclaimer: I don't think they even | those that open when you don't want
            admit I work here.      | them to. - Roger Zelazny "Blood of Amber"



More information about the Comp.unix.questions mailing list