# fileopen

Opens a file.

    fileopen <file handle> <filename> <append flag>

## Remarks

Opens a file specified by <file name>.
If the file does not exist, it is created and then opened. If the file is successfully opened, the file handle is returned in the integer variable <file handle>. Otherwise, <file handle> is set to -1.
If <append flag> is zero, the file pointer is set to the beginning of the file. If <append flag> is non-zero, the file pointer is set to the end of the file.
Also, the file is opened in the binary mode.

## Example

    fileopen fhandle 'data.dat' 0
    fileopen fhandle 'data.dat' 1

    fileopen fhandle 'test.bat' 0
    filewrite fhandle 'md .\v20080619_Test'
    fileclose fhandle
    pause 5
    exec 'cmd /c test.bat'
    pause 10
    end

## Reference

filewrite
fileclose