openFile()

Synopsis

Opens path according to the mode readWrite. Returns a file handle if successful. The file handle must be closed by a call to closeFile() in order for the file to be created.

The precise behavior of this function are defined by the host operating system and file system.

Syntax

openFile ( path As String, _
           readWrite As Name, _
           Optional fileFormat As Name = :ASCII ) As User 
Argument Type Description
path String The path to the file to be opened.
readWrite Name The file open mode, one of: :Read, which opens the file read-only :Write, which opens the file for writing (and deletes any existing file). :WriteAppend, which opens the file but appends any writes to the end, preserving any existing contents.
fileFormat Name Optional; the file format; options are:
  • :ASCII, 8-bit characters in ASCII encoding (default)
  • :Unicode, 16-bit characters in Unicode encoding
  • :RawBinary, which is pure binary data
Any other values will generate an error.