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-Thread: 103376,c72c8726f7de6c9b X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!wn14feed!worldnet.att.net!209.244.4.230!newsfeed1.dallas1.level3.net!news.level3.com!news.binc.net!kilgallen From: Kilgallen@SpamCop.net (Larry Kilgallen) Newsgroups: comp.lang.ada Subject: Re: File manipulations in Ada.Text_IO Date: 2 Aug 2005 07:31:02 -0500 Organization: LJK Software Message-ID: References: <1122919474.611248.151950@z14g2000cwz.googlegroups.com> <42ee677a$0$11756$9b4e6d93@newsread4.arcor-online.net> <67kFmodka+Zb@eisner.encompasserve.org> NNTP-Posting-Host: eisner.encompasserve.org X-Trace: grandcanyon.binc.net 1122985827 32724 192.135.80.34 (2 Aug 2005 12:30:27 GMT) X-Complaints-To: abuse@binc.net NNTP-Posting-Date: Tue, 2 Aug 2005 12:30:27 +0000 (UTC) Xref: g2news1.google.com comp.lang.ada:3895 Date: 2005-08-02T07:31:02-05:00 List-Id: In article , "Randy Brukardt" writes: > "Larry Kilgallen" wrote in message > news:67kFmodka+Zb@eisner.encompasserve.org... >> In article , Jeffrey > Carter writes: >> > Georg Bauhaus wrote: >> >> >> >> One way using standard Ada is an attempt to open the file. >> >> If the external file doesn't exist, exception Name_Error >> >> is raised. >> > >> > Ada 0X will have Ada.Directories as part of the standard library, which >> > will include such a function. >> >> But such a function for a non-wildcarded filename is always going >> to be susceptible to a race condition if the next step would be >> to open the file. The file might be deleted or created between >> the test and using the information gained from the test. > > True, but that's a general problem with I/O, not specifically with the > directories operations. Generally, if you're doing I/O, you have to handle > exceptions and never assume that they won't be raised, no matter what > pretests you might have done. Yes. My point is that the utility of checking first before attempting to open a file is vastly overrated.