W filename WX filename WA filename WB filename WXA filename WXB filename
w wb /bcdfile 3,5wx temp
W writes one or more lines to a file. If you do not specify an address, W writes the entire contents of the buffer. If you specify one address, W only writes that line. If you specify two addresses, W writes all the lines between and including the given lines. In this case, the first address must precede the second in the buffer.
W creates a file with the given name if one does not already exist. If the file name contains a slash /, FRED tries to create a permanent file; otherwise, FRED tries to create a temporary file.
When a write operation succeeds, statistics about the operation are printed on the terminal provided the W was not executed from a buffer. The statistics take the form
12,345,6789 b(name) user/cat/file
The first number gives the number of blocks read; the second number gives the number of lines read; and the third number gives the number of characters. After this comes the name of the buffer and the full name of the file.
If FRED creates a file in the write operation, it marks this on the same line as the statistics. A t shows that a temporary file was written while a p shows that a permanent file was created.
If you do not specify a line address in the W command, FRED sets the current buffer's file name to the name of the file written, as soon as the write is successfully completed. This associated name is the full name of the file, regardless of the name specified in the W command. Even if the command was
w /file
FRED will use the full name userid/file (if your current directory is your userid).
As a special convention, a W command with the line address 0, as in
0w filename
writes an empty file. If the file does not already exist, an empty file is created. This is the only time that a line address of 0 is accepted for W.
W does not affect the current line pointer ".". After a write operation, FRED sets the count register to the number of blocks written.
Copyright © 1998, Thinkage Ltd.