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-06-02 17:17:36 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: I/O - exception handling Date: Mon, 2 Jun 2003 19:18:46 -0500 Organization: Posted via Supernews, http://www.supernews.com Message-ID: References: <3ED4114A.5060204@spam.com> <3EDA24D2.6060003@attbi.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Newsreader: Microsoft Outlook Express 4.72.3612.1700 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3719.2500 X-Complaints-To: abuse@supernews.com Xref: archiver1.google.com comp.lang.ada:38412 Date: 2003-06-02T19:18:46-05:00 List-Id: Robert I. Eachus wrote in message <3EDA24D2.6060003@attbi.com>... >Randy Brukardt wrote: > >> It wouldn't be *expected*, but the standard *allows* it, so the truly >> paranoid programmer would have to take that into account. And even if >> you defined it not to raise any IO_Exceptions, it still could raise >> Storage_Error or Program_Error, so you can't claim that it never, ever >> raised any exceptions anyway. >> >> As I said, its not worth worrying about; in practice, it won't raise an >> exception, and there is no need to protect it. But you can't determine >> that from the standard (and there is no possible standard language from >> which you could). > >At the risk of being repitious there are cases in Ada where unusual >behavior can be associated with particular file types. A good example I >ran into years ago was an OS where opening a pipe required a special >call that returned two file descriptors, and only the first (the write >end) could be closed, which closed the whole pipe. An excellent example >of where a call to Close should raise Use_Error. But notice that >opening the pipe took a non-standard Open call. Of course, but the question I was answering was about Is_Open, not Close. I would give different advice about Close, for the reasons you give. But a compiler raising Use_Error on Is_Open would be pretty weird (and unhelpful). Randy.