Writing out a file

Stedi has several commands for saving the results of an editing session to a file. These commands have counterparts respectively using the function keys and the command line commands. Moreover there is a number of options to be considered which affect the saving of the file. The commands and the associated options will be discussed below. All the commands are operational only when the cursor is in the text field.

The function keys associated with output commands are as follows.

shift-F8
Write file. Pressing the shift-F8 key combination yields a prompt on the message line. One can type in the name of a file followed by a carriage return. This results in saving the file in the current buffer under the name typed in. This write command cannot be saved in the history buffers of the command line. Pressing shift-F8 invokes the use of a very special buffer that is always available, even when all other commands in the editor start complaining about a lack of memory. Thus the user can always write his results to file.

F9
Save file. The contents of a buffer can be given a name that is known by the editor if the file being edited was read into the buffer by name originally, or if a write command has been issued which assigned the file a name. (This is the name displayed on the right hand side of the message bar - including the path name associated with it which can be displayed with the Alt-L command.) If the current buffer already has a name for its contents, the F9 command causes the contents of the buffer to be written to a file of that name. If no name exists yet - the last 12 characters of the message bar are empty - the editor will report that it cannot save a buffer without a name.

F10
Save and quit. The first stage of this command is the same as the F9 command, that is, it saves the contents of the current buffer. This is followed by an exit command which is equivalent to shift-F10 (see the chapter on Running stedi p. [*]).

With the command line, the following commands are available:

W name or W'name
This write statement is equivalent to the shift-F8 command except for that now the regular procedures for the use of commands in the command line are followed. This means that this command will be entered in the command history. If the requested file exists already the user is asked to confirm that he wants to overwrite this file. This is to protect the user against loss of files, as it happens occasionally that one uses the write command instead of the read command.

W name > or W'name >
This is a write statement that appends the output to the named file, rather than creating a new file. Because the original file still exists as the head part of the new file no backup is made.

S or Save
Save file. This is the same as F9.

Q or Quit
Quit. This command is the same as the shift-F10 command (see the chapter on Running stedi p. [*]).

SQ or SaveQuit
Save and Quit. This command is the same as F10.

When a write command is issued, there are several messages that could indicate that something prevented the writing of the file. There could be several possible causes: a lack of disk space, a name was selected that belonged to a directory, the file that existed by that name could not be renamed to a .bak file (backup version) or the backup version that existed already could not be removed. These last two causes could have to do with a lack of rights to do anything with these files.



Subsections