From: Thomas Demmer Newsgroups: comp.os.msdos.djgpp Subject: Re: Writing to a file from dtor doesn't work! Date: Tue, 04 Nov 1997 18:22:50 +0100 Organization: Lehrstuhl fuer Stroemungsmechanik Lines: 34 Message-ID: <345F59EA.3A6081BF@LSTM.Ruhr-UNI-Bochum.De> References: NNTP-Posting-Host: c64.lstm.ruhr-uni-bochum.de Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Eli Zaretskii wrote: > > On Mon, 3 Nov 1997, Nate Eldredge wrote: > [...] > > move two lines of code. *Are* files Supposed to work in destructors? > > IMHO, people who use C++ extensively should answer this. There might > be conflicts with objects that use I/O streams and are destructed by > global destructors. DJ? > > Is it at all safe to assume that file handles beyond the 3 standard > streams are available in the global destructor? After all, they *are* > run after `main' returned, so at least in principle, this is a > never-never land for the application, no? Hmm. The destructor is usually called after the scope of the variable end. So an object in main is deleted after main, but _before_ (IMHO) the libc cleanup. So I would think this is a bug. -- Ciao Tom ************************************************************* * Thomas Demmer * * Lehrstuhl fuer Stroemungsmechanik * * Ruhr-Uni-Bochum * * Universitaetsstr. 150 * * D-44780 Bochum * * Tel: +49 234 700 6434 * * Fax: +49 234 709 4162 * * http://www.lstm.ruhr-uni-bochum.de/~demmer * *************************************************************