Writing out or Saving files

There are several options for saving your program to the disk. The most straightforward way is to use the function keys. The options are set out in the following table:

Save and Write commands

Command Action
F9 save the file under its own name
F10* save the file under its own name
  and then exit the program
sh-F8 save (or write) the file under
  a new name
sh-F10 exit the program

*This command which is a combination of the save command (F9) and the exit command (shift-F10) is by far the most commonly used method for most programmers. To Save the File Under Its Own Name:

F9
With this command, you have various options about what kind of backup file the editor will make. You can have a normal backup file made, an invisible backup (not recognized by the desktop but nevertheless present) or no backup at all.
The normal backup file
stedi saves the original version file being edited but changes its extension to `BAK' before saving the edited version.

*

The invisible backup file
* The original file is also saved with the extension `BAK' but the file * is marked as invisible. This is a useful option if you are working * from a hard disk (so disk space is not an issue) and you don't want to * clutter up the screen with too many files. Such files can * nevertheless be seen and manipulated using the GPSHELL shell program * although they are invisible to the desktop.

No backup
A somewhat more risky option but sometimes necessary if little disk space is available.
The Alt-B command cyclically toggles through the three backup options, and the option choice is recorded on the status bar with a `B' (normal backup), `b' (invisible backup) or `$\dagger$' (no backup). The F9 command is not allowed if you have created a new file to which you have not given a name. In that case, you must assign a name to the file when you save it by using the shift-F8 command.

To Save your File to Disk and Quit:

F10
This command is the combination of F9 (Save) and shift-F10 (Quit). If any of the buffers contain files that have been changed, you will be queried as to whether you want to quit and leave them unsaved. In this way, stedi protects against accidentally exiting without saving valuable work. The buffers containing files which have not been saved since alteration will be enumerated in the query. A simple `yes' answer to the query allows you to leave the editor without saving the files. An answer of `no' lets you remain in the editor so that you can save the work before quitting.
To Write a File to Disk Under a Different Name:
shift-F8
This command allows you to save the file under a new name. When the command is given, you will be asked for a name under which to save the file. You may type in a full path name (disk and folder names) as well as the file name. For example, suppose you want to save your program `Hello stedi' under the name `hstedi.c' and wanted to put it in a folder called `foo' on a disk in disk drive A. This can be accomplished by typing the following string when prompted:
A:\foo\hstedi.c
stedi also allows somewhat more flexibility in the format of the path name. For instance, you may replace any backslashes with Unix style slashes and stedi will recognize the path. See the chapter on reading, writing and printing for details on path names.

To Leave the Program Without Saving Anything:
shift-F10
This command is used when you do not wish to save the work of an editing session. If you have already saved everything or you have not made any changes, then F10 is equivalent to this command.
Stedi also offers command line commands equivalent to some of the above keyboard commands. These are:
s - Save. Equivalent to F9.
q - Quit. Equivalent to shift-F10.
sq - Save and Quit. Equivalent to F10 (F9 plus shift-F10).



Subsections