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!news1.google.com!newsread.com!news-xfer.newsread.com!newspeer.monmouth.com!newsswitch.lcs.mit.edu!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: File manipulations in Ada.Text_IO Date: 08 Aug 2005 18:25:13 -0400 Organization: The World Public Access UNIX, Brookline, MA 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: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1123539913 24321 192.74.137.71 (8 Aug 2005 22:25:13 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Mon, 8 Aug 2005 22:25:13 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: g2news1.google.com comp.lang.ada:4039 Date: 2005-08-08T18:25:13-04:00 List-Id: Jeffrey Carter writes: > Larry Kilgallen wrote: > > 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. > > That's true in the general case, and something I've never encountered in > 30 years of actual SW development, including software that was intended > to manipulate the same file from different applications running at the > same time. How do you know? ;-) I mean, if somebody writes code that contains such a race condition, and their customer trips over it once in a while, the programmer might never find out about it. The server process crashes once in a while. Nobody knows why. So the solution is to restart the server by hand. (Yuck.) Race conditions, by their very nature, are impossible to detect with any confidence via testing. - Bob