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,6482d0ae6dcb1b4c X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-09-22 12:24:37 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!news-hog.berkeley.edu!ucberkeley!enews.sgi.com!sdd.hp.com!usc.edu!newspeer.cts.com!galanthis.cts.com!127.0.0.1.MISMATCH!not-for-mail Sender: kst@king.cts.com Newsgroups: comp.lang.ada Subject: Re: if file exist References: From: Keith Thompson Date: 22 Sep 2002 12:24:35 -0700 Message-ID: X-Newsreader: Gnus v5.7/Emacs 20.7 NNTP-Posting-Host: 209.68.192.180 X-Trace: 1032722675 nntp.cts.com 324 209.68.192.180 Xref: archiver1.google.com comp.lang.ada:29262 Date: 2002-09-22T12:24:35-07:00 List-Id: Simon Wright writes: > Dale Stanbrough writes: > > Ask the operating system? Another way is to attempt to open > > the file. If it opens successfully then it exists. > > and is readable (assuning you tried to open it for read!). It might > exist and not be readable, in which case this test would fail. Or, even if the file exists and is readable, the open might fail for any number of reasons depending on the OS. For example, in an OS that distinguishes between binary and text files, using Text_IO.Open on a binary file might fail. (Then again, in such an OS, knowing whether a file exists might not be all that useful.) -- Keith Thompson (The_Other_Keith) kst@cts.com San Diego Supercomputer Center <*> Schroedinger does Shakespeare: "To be *and* not to be"