From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d8a4797a79f9c90f X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-05-27 13:34:03 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!nntp.cs.ubc.ca!cyclone.bc.net!news.uunet.ca!nf3.bellglobal.com!nf1.bellglobal.com!nf2.bellglobal.com!news20.bellglobal.com.POSTED!not-for-mail Message-ID: <3ED3C82D.50806@cogeco.ca> From: "Warren W. Gay VE3WWG" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: I/O - exception handling References: <3ED38FA6.5050002@cogeco.ca> <1054064423.70494@master.nyc.kbcfp.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 27 May 2003 16:18:53 -0400 NNTP-Posting-Host: 198.96.223.163 X-Complaints-To: abuse@sympatico.ca X-Trace: news20.bellglobal.com 1054066733 198.96.223.163 (Tue, 27 May 2003 16:18:53 EDT) NNTP-Posting-Date: Tue, 27 May 2003 16:18:53 EDT Organization: Bell Sympatico Xref: archiver1.google.com comp.lang.ada:37862 Date: 2003-05-27T16:18:53-04:00 List-Id: Hyman Rosen wrote: > Warren W. Gay VE3WWG wrote: > > If the underlying fclose() fails this could represent > > a variety of serious program flaws and/or media defects: > > It could represent Martians shooting rayguns at your disk, > too. My point is that there's absolutely nothing you can > do about it except perhaps trying to recreate the entire > file. Except for the point made below, my point only was to note that the problem "occurred", but see below.. >> I think raising exceptions in close makes sense > > The problem is that if you're doing close in finalization, > allowing an exception to escape leads to program termination > in C++ and raising Program_Error in Ada. That's why you have > dual-mode closing, with an explicit close request that you > can check for error, and an automatic close in finalization > where you ignore the error. Yes, OK. Your point is about this happening in finalization (or destructor). Yes, this is a thorny problem indeed, and when this happens, "Mars has attacked!" ;-) -- Warren W. Gay VE3WWG http://home.cogeco.ca/~ve3wwg