KS> Just that I still think that the most obvious way to implement
KS> fopen() and friends is simply just do a malloc() + relevant magic
KS> and return the value of the malloc()...
AR> Well, as far as implementation goes I agree with that.
I disagree - if the implementation doesn't remember all of its "pointers",
how is it supposed to flush their buffers when the program exits (as the
standard seems to say it will)? Closing is no problem, just close() every
possible handle. It's the buffer that the FILE struct points to that I'm
talking about here - if the RTL has lost track of the struct, how will it be
flushed?
AR> It is just too bad that it was not efficient enough in real old DOS
ays.
AR> But even then a fopen()ed FILE pointer _still_ should
AR> be deallocated with fclose() ;-)
Right. However, the standard allows for exit() to fclose everything for
you... :-)
---
---------------
* Origin: Tanktalus' Tower BBS (1:250/102)
|