Re: Printing files every step
- From: Keith Thompson <kst-u@xxxxxxx>
- Date: Fri, 19 May 2006 21:43:41 GMT
CBFalconer <cbfalconer@xxxxxxxxx> writes:
Keith Thompson wrote:
Roberto Waltman <usenet@xxxxxxxxxxxx> writes:... snip ...
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.
No. Try CP/M for example, and FCBs. The space is in the users
area, and limited only by what he can get. The disadvantage is
that the user has to close files properly.
Does "the user has to close files properly" imply that if I fail to
close a file, it will continue to consume system resources after my
program terminates?
Note that the standard says that exit() closes all open streams (and
returning from main() is equivalent to calling exit(), so a C program
under a conforming implementation shouldn't have this problem.
Of course closing files you opened is a good idea anyway.
--
Keith Thompson (The_Other_Keith) kst-u@xxxxxxx <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
.
- Follow-Ups:
- Re: Printing files every step
- From: CBFalconer
- Re: Printing files every step
- From: Gordon Burditt
- Re: Printing files every step
- From: Roberto Waltman
- Re: Printing files every step
- References:
- Printing files every step
- From: Mokkapati
- Re: Printing files every step
- From: Gordon Burditt
- Re: Printing files every step
- From: Roberto Waltman
- Re: Printing files every step
- From: Keith Thompson
- Re: Printing files every step
- From: CBFalconer
- Printing files every step
- Prev by Date: Re: Printing files every step
- Next by Date: Re: single x double precision on 32bit arch
- Previous by thread: Re: Printing files every step
- Next by thread: Re: Printing files every step
- Index(es):
Relevant Pages
|