# OPEN

> [HTML Version](opensequential.htm)

**OPEN #ch, fspec, INPUT \{,WAIT'FILE\}**

**OPEN #ch, fspec, OUTPUT \{,WAIT'FILE\}**

**OPEN #ch, fspec, APPEND (,WAIT'FILE\}**

**Parameters**

_ch_ is an integer expression specifying the file channel which will be needed for subsequent I/O operations on the file. File channel 0 refers to the terminal, in which case the OPEN statement will have no effect.

_fspec_ is a string expression specifying the file to open, using native or DevPPN. See the following topic _.NULL files_

_WAIT'FILE_ only applies when the [LOKSER](lokser_sp.md) system option is active and causes the program to wait for exclusive access to the file.

**Comments**

Opening a file for OUTPUT creates an empty file. If the file already existed, it is first deleted. 

APPEND is equivalent to OUTPUT except that if the file does exist, it is not first deleted.

Sequential files can be connected to TCP sockets; [MX\_FILESOCK](mx_filesock.md) for details.

**See Also**

•	[Search Paths - Data Files](search-paths.md#datafilesearchpath)