C.WRITE - ***OBSOLETE***use ".SEEK".

Usage:

old_unit = c.write( unit );

Where:

unit
is the number of an I/O unit which is already open.
old_unit
receives the unit number of the previous write unit.

Description:

C.WRITE makes "unit" the current write unit and returns the number of the previous write unit. If "unit" is already an output unit or if "unit" is not a file, no further action is taken. If "unit" is an input file, the file is backspaced over the last block read. Subsequent output functions will write on the file after the last record read. Note that it is an error to attempt input from a file after making it the write unit with C.WRITE.

C.WRITE assumes that the given file was originally accessed with write permission. If this is not the case, attempts to write on the file will likely result in an error. The best way to avoid problems like this is to open the given file with a command of the form

open( filename, "wr" );

Note that you should specify "wr", not "rw". "wr" will give you write permissions, but will open the file initially for reading.

Copyright © 1996, Thinkage Ltd.