From: Dominique Dhumieres (Dominique.Dhumieres@LPS.ENS.FR)
Date: 16 Sep 99, 18:21 EST
From: Dominique Dhumieres <Dominique.Dhumieres@LPS.ENS.FR> Subject: Re: "saveas -f filename" Aaron Montgomery wrote: > >saveAs > >--> The SFPutFile dialog appears, with the name of the front window > > put into the filename-editing field. > > > >saveAs blahblah > >--> The SFPutFile dialog appears, with "blahblah" put into the > > filename-editing field. > > In both of these cases, the file is written to the disk, and marked > as clean, correct? > > >saveAs -f blahblah > >--> If there is no file named "blahblah" already existing in the > > current directory, then, nothing happens, except that the > > StatusWin displays a message saying: "Can't launch file." > > Yep, I just saw the C code that does that. > Is this appropriate or should saveAs create the file? > > >--> If there is already some file named "blahblah" in the current > > directory, then, running the above command simply renames the > > front window to "blahblah", and makes the window marked "dirty". > > (Nothing is actually written to disk at this time.) > > That's what I thought, is this what people want? Admittedly, I am > really (really, really, really, ...) hesitant to change the meaning > of any of Alpha's commands, but this seems a little incongruous with > the other two cases. At the very least, this ought to make it into > the documentation so someone doesn't use saveas -f in a script and > lose data. The Alpha Commands manual reads: * saveAs ?-f? [def name] - save current window with new name. Optionally takes a default filename. Returns complete path of saved file, if ok hit, otherwise TCL_ERROR returned. If '-f' flag given, then we force the save without any standard-file dialog. In my opinion the actual behavior of 'saveAs' with the '-f' flag is inconsistent with the manual: i.e. I would expect that - if the file "blahblah" does not exist, it is created and the window is saved; - if the file exists then a 'yesno' dialog box is open to ask the user if he really wants to overwrite the old file, the 'saveAs' being performed only after a 'yes' answer. With its present behavior, the '-f' flag seems to me not only useless but also danferous for existing files. Dominique d'Humieres Laboratoire de Physique de l'ENS, 24, rue Lhomond, 75231 Paris cedex 05, FRANCE tel. 33 1 44 32 38 01 fax. 33 1 44 32 34 33 e-mail: dominiq@physique.ens.fr