Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!usc!wuarchive!sdd.hp.com!hplabs!hpfcso!hplvec!bayes From: bayes@hplvec.LVLD.HP.COM (Scott Bayes) Newsgroups: comp.sys.mac.hypercard Subject: Re: Re: save stack as Message-ID: <1170005@hplvec.LVLD.HP.COM> Date: 6 Feb 91 00:08:27 GMT References: <4646@mindlink.UUCP> Organization: Hewlett-Packard Co., Loveland, CO Lines: 22 > Sounds like what you might need is the "File Exists" XFCN. As the name > suggests it tests whether or not a file exists given a full pathname. > You could then quizz the user in Hypertalk as to whether or not they > want to overwrite the file and use one of the various "delete file" > XCMD's if they do, or just automatically add a "1" to the name otherwise. > "FileExists" is a part of the Support Tools eXternals 1.2.5 package > which (I think?) is available on apple.com. > > Neale > > **************************************************************************** > Neale Hays > n_hays@fennel.cc.uwa.oz.au The University of Western Australia > **************************************************************************** Watch out on networks, or in multi-tasking environments. In my own OS, I've seen cases where fileExists returns false, but when I go to create the new file, I get an error due to some user or task creating the file after the existence test, before my create. You really need an atomic operation, like createIfNotExisting, or createAndReportSuccess. Scott "they pay me to think of stuff like this" Bayes