comp.lang.ada
 help / color / mirror / Atom feed
From: "Robert I. Eachus" <rieachus@attbi.com>
Subject: Re: I/O - exception handling
Date: Sun, 01 Jun 2003 16:08:11 GMT
Date: 2003-06-01T16:08:11+00:00	[thread overview]
Message-ID: <3EDA24D2.6060003@attbi.com> (raw)
In-Reply-To: vdfdfnmacnf8b2@corp.supernews.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.

Another example as I said was that on systems where closing Standard_XXX 
is not allowed, Close should raise Use_Error--if you can somehow get 
ahold of a copy of the (Ada) file object for those files. Notice that 
Close takes an in out File_Type, so the Standard_XXX or Current_XXX 
calls cannot be used as a parameter.  (A user could use the forms which 
return File_Access, and play some games to convert from File_Access 
which is access constant File_Type, then call Close on the result--and 
get what he or she deserves. ;-)

The Ada culture is to ignore these cases--unless you are the user in 
question.  Then you had better look for all sorts of "unexpected" 
exceptions resulting from your use of Unchecked_Conversion or whatever.





  reply	other threads:[~2003-06-01 16:08 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-26 13:05 I/O - exception handling Sergey Koshcheyev
2003-05-26 13:33 ` Preben Randhol
2003-05-26 14:11   ` Sergey Koshcheyev
2003-05-26 14:29     ` Preben Randhol
2003-05-26 14:31       ` Preben Randhol
2003-05-26 14:39       ` Sergey Koshcheyev
2003-05-26 16:57         ` Preben Randhol
2003-05-26 17:48           ` Sergey Koshcheyev
2003-05-26 18:08             ` Preben Randhol
2003-05-26 18:48               ` Sergey Koshcheyev
2003-05-27  1:24                 ` Hyman Rosen
2003-05-27  2:20                   ` Larry Kilgallen
2003-05-27  2:38                     ` Hyman Rosen
2003-05-27 16:17                       ` Warren W. Gay VE3WWG
2003-05-27 19:40                         ` Hyman Rosen
2003-05-27 20:18                           ` Warren W. Gay VE3WWG
2003-05-27 10:31                     ` Larry Kilgallen
2003-05-27 21:43                       ` Hyman Rosen
2003-05-27  5:33           ` Robert I. Eachus
2003-05-27 13:53             ` Preben Randhol
2003-05-27 12:01           ` Lutz Donnerhacke
2003-05-26 14:12   ` Simon Wright
2003-05-26 14:24     ` Preben Randhol
2003-05-26 14:52 ` Jean-Pierre Rosen
2003-05-26 15:26   ` Sergey Koshcheyev
2003-05-26 15:45 ` Hyman Rosen
2003-05-26 16:25   ` Sergey Koshcheyev
2003-05-27  1:35     ` Hyman Rosen
2003-05-28 21:47       ` Robert A Duff
2003-05-26 16:31 ` Steve
2003-05-27  2:36 ` Anisimkov
2003-05-27  7:21   ` Sergey Koshcheyev
2003-05-27 13:47     ` Preben Randhol
2003-05-27 19:01       ` Sergey Koshcheyev
2003-05-27 16:50     ` Dmitriy Anisimkov
2003-05-27 18:11       ` Ludovic Brenta
2003-05-28  1:27   ` Jeffrey Carter
2003-05-28  7:33     ` Sergey Koshcheyev
2003-05-28  9:08       ` Preben Randhol
2003-05-28 18:07         ` Randy Brukardt
2003-05-28 22:51           ` Robert I. Eachus
2003-05-29  2:03             ` Jeffrey Carter
2003-05-29  8:39               ` Manuel Collado
2003-05-30  6:56           ` Preben Randhol
2003-05-30  9:33             ` Larry Kilgallen
2003-05-30 11:13               ` Preben Randhol
2003-05-30 11:39                 ` Larry Kilgallen
2003-05-30 11:41                   ` Preben Randhol
2003-05-30 19:51                 ` Randy Brukardt
2003-06-01 16:08                   ` Robert I. Eachus [this message]
2003-06-03  0:18                     ` Randy Brukardt
2003-06-03  4:16                       ` Robert I. Eachus
     [not found] ` <slrnbd6m69.vh.lutz@taranis.iks-jena.de>
2003-05-27 14:06   ` Preben Randhol
2003-05-27 15:59     ` Lutz Donnerhacke
2003-05-27 19:05   ` Sergey Koshcheyev
2003-05-27 19:32     ` Larry Kilgallen
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox