Help Contents / Communication / File opening / openUpdate

openUpdate filename

command.  Opens the named file for reading and writing. The read and write position is initially set to the end of the old file, if any. Note: each open file has only one position, for both reading and writing. If a file opened for update is both READER and WRITER at the same time, then SETREADERPOS will also affect WRITERPOS and vice versa. Also, if you alternate reading and writing the same file, you must SETREADERPOS between a write and a read, and SETWRITERPOS between a read and a write. 

Example: 

	openUpdate "temp.txt 
	setReader "temp.txt 
	pr readlist		;This is a test file! 
	pr readlist		;and a line more 
	setReader [] 
	close "temp.txt 


previous: openAppendBin	next: openUpdateBin
