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,FREEMAIL_FROM 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-26 08:45:24 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!nntp.cs.ubc.ca!cyclone.bc.net!in.100proofnews.com!in.100proofnews.com!news.stealth.net news.stealth.net!news.stealth.net!cyclone1.gnilink.net!spamkiller2.gnilink.net!nwrdny01.gnilink.net.POSTED!53ab2750!not-for-mail From: Hyman Rosen User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4b) Gecko/20030524 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: I/O - exception handling References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Mon, 26 May 2003 15:45:21 GMT NNTP-Posting-Host: 162.84.146.112 X-Complaints-To: abuse@verizon.net X-Trace: nwrdny01.gnilink.net 1053963921 162.84.146.112 (Mon, 26 May 2003 11:45:21 EDT) NNTP-Posting-Date: Mon, 26 May 2003 11:45:21 EDT Xref: archiver1.google.com comp.lang.ada:37793 Date: 2003-05-26T15:45:21+00:00 List-Id: Sergey Koshcheyev wrote: > Is there a better solution or is this sort of thing OK in the Ada way? The C++ way is to declare an object with a destructor (Finalize in Ada) which holds the File_Type and closes it upon destruction. Since this happens upon block exit, regardless of how that happens, you only have to have one Close, and of course, once you have such an object, you can use it everywhere. Ada makes it somewhat painful to do this since types with Finalization have to be declared at library level.