Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!apple!jdevoto From: jdevoto@Apple.COM (Jeanne A. E. DeVoto) Newsgroups: comp.sys.mac.hypercard Subject: Re: save stack as Summary: "if there is a file..." Message-ID: <48829@apple.Apple.COM> Date: 5 Feb 91 04:52:13 GMT References: <4646@mindlink.UUCP> <1991Feb4.054700.2881@fennel.cc.uwa.oz.au> Organization: Apple Computer Inc., Cupertino, CA Lines: 31 In article <1991Feb4.054700.2881@fennel.cc.uwa.oz.au> n_hays@fennel.cc.uwa.oz.au writes in reply to John Miller: >> A problem with the "save stack" command is that it fails >> if the a file already exists with the name given. There >> doesn't seem to be any magical keywords such as "with >> overwrite" or "with extreme prejudice" to cause it to >> overwrite a file that already exists > >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. Actually, you don't need FileExists any more, since 2.0 has an operator "there is". if there is a file "Unknown Magnanimity:Stuff:Gigs:CI$" then beep if there is a card button "foo" if there is a card ID 22314 if there is not a window "My Palette" if there is no menuItem "Paste" of menu "Edit" you get the idea. This very handy operator doesn't seem very well known. -- ========= jeanne a. e. devoto ======================================== jdevoto@apple.com | You may not distribute this article under a jdevoto@well.sf.ca.us | compilation copyright without my permission. ______________________________________________________________________ Apple Computer and I are not authorized | CI$: 72411,165 to speak for each other. |