Keith Thompson wrote:
>
> Roberto Waltman <> writes:
> [...]
[...]
> > You may not be able to open 100 files in a single program, even if
> > your code is 100% correct from the coding and logic points of view.
> > And if you can open 100 files, that means 100 less are available to
> > the system as a whole, potentially causing other programs to fail.
>
> Does *every* system impose this kind of limit? I know that many do,
> but it's easy to imagine a system where the number of simultaneously
> open files is limited only by the amount of memory necessary to
> describe them. Such a system would have no fixed-size tables of file
> descriptors, for example.
I've seen a system which dynamically allocated its tables, but it still
"limited" the number of open files for a process to 2000. (Or was it
20,000? It's been quite a few years. In either case, it was much
better than the 20 file limit imposed by the systems I had previously
used.)
The problem with "limited only by the amount of memory" is that a runaway
program could use all of that memory, so arbitrary limits still have their
place in a multitasking environment. Think "file leak" as a situation not
unlike a "memory leak" with malloc().
--
+-------------------------+--------------------+-----------------------------+
| Kenneth J. Brody |
www.hvcomputer.com | |
| kenbrody/at\spamcop.net |
www.fptech.com | #include <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------------+
Don't e-mail me at: <private.php?do=newpm&u=>