Skip to main content
Skip table of contents

f$FileOpen (f$DateiÖffnen)


f$FileOpen (f$DateiÖffnen)

Open a file for reading or writing. A file number is returned which identifies the opened file for further read/write operations. To ensure that an input file also exists or that an already existing file is not overwritten with an output file, you can check the existence of a file beforehand with the f$FileExists function.

Please note that, when entering a path in the file name, the character "\" must be entered twice ("\\").

Syntax:

FileNo = f$FileOpen( Filename, Mode )

 

Argument

Type

Meaning

 

Filename

String

File name including path

 

Mode

String

Mode of access to the file:
'r': read an existing file
'w': write into new file
'a': write (attach) into existing file
'r+': read and write into existing file
'w+': read and write into new file
'a+': attach into existing or new file

'b' : open as binary file. This option can be combined with other options, e.g. 'wb' write binary to a new file.

Result:

Integer

File number or 0 if the file cannot be opened.

Example:

No = f$FileOpen( 'c:\\customers\\customer.txt', 'r' )
→ The file is opened for reading

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.