Reading a file can be done in one of five different ways:
Several options are available when reading files this way. They should precede the name of the file as a separate parameter. They are:
The other form concerns the reading of a part of a file. The command `R name < number' reads from the file `name' starting at byte `number'+1 Again there may also be a quote between the R and `name'. This mode is very useful when processing very large files. Normally only the first part of such a file can be read and the message "Not enough memory. Buffer made View-Only." would appear, notifying the user of the inaccessibility of the tail part of the file. By reading from different positions in the file one can edit the file in several steps.
When a file is read into a buffer that doesn't have a name yet, the buffer will inherit the name of this file. Its path name will also be remembered for later writing. If the save command is issued (see below) the editor will try to overwrite the old file (usually after making a backup). More details follow in the next section.
When a file is read, all occurrences of a carriage return or a linefeed will be seen as the end of a line. If a carriage return is encountered, the editor checks whether a linefeed follows after it. If this is the case, the linefeed is skipped. If a linefeed is encountered, the editor checks whether a carriage return comes after it. If this is the case, the carriage return is skipped. The result is that <cr>, <lf>, <cr><lf> and <lf><cr> are all interpreted as a single end of line. This avoids problems with the various conventions that exist. In addition there is the raw mode in which neither <cr> nor <lf> are interpreted. They are put in the text like all the other characters. For more information about this mode, one should read the information about it in the next section.
Lines in stedi should never contain more than 255 characters. Thus in order not to lose any part of a file being read in, any line that contains more than 255 characters is split up into one or more lines during the reading in process. The user will be notified that this may be about to happen and will be asked for his permission. If this permission is denied the reading will be stopped at the offending position.
If there is not enough memory to read in a complete file that has been specified, stedi will read as much as will fit in the memory and then issue an error message. The only limitation on the size of a file being read in is the amount of memory available. Hence in marginal cases a file may still be edited if you are able to gain more memory by removing some utilities or making a ram disk a little smaller. If you are faced with such a big file that it cannot be edited in one piece, one may start with editing the part that could be read, write it to a file with a different name (!), clear the buffers and then read in a part of the file after skipping a number of bytes. When writing parts of a file they can be pasted together as can be seen in the > option of the write command.