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,7eef1e530c6ffb21 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!panix!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: procedure Make_File_Gone (Name : in String); Date: Sat, 23 Jul 2011 10:55:23 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1311432923 31948 192.74.137.71 (23 Jul 2011 14:55:23 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Sat, 23 Jul 2011 14:55:23 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:kYWd1FbVwGsXRsOxf146fwYs0Bo= Xref: g2news2.google.com comp.lang.ada:21297 Date: 2011-07-23T10:55:23-04:00 List-Id: tmoran@acm.org writes: >> I'm of course partial to Purge for this use. :-) > > Another verb. Both the phrase Delete_File and the word Purge say "go > do something" and they leave unclear what to do if you can't do the > action. I'd like to concisely make clear the post condition I'm trying > to achieve - in this case, the absence of a file of the given name. I think you mean precondition. The postcondition of the two is the same -- the file isn't there. I think distinguishing Delete_File and Delete would be confusing. How would you remember which is which? I'd say Delete_File should raise an exception if the file doesn't exist, and Maybe_Delete_File should silently do nothing in that case. > Ideally this should be clear from the procedure name without having > to look in the ARM or depend on a comment of uncertain modernity. > > And yes, there could be a race where someone created a new file of that > name immediately afterward, but avoiding such races is part of the > higher level design. Sure, that's true of pretty-much all file operations. - Bob