| FAccess | Function (ROM Call 0x3D4)

AMS 2.00 or higher | files.h

unsigned short FAccess (const char *fileName, unsigned short mode, const char *typeName);

Check to see if a file can be opened for a given mode without modifying the file.

FAccess checks to see if the file fileName can be opened for the given mode mode without modifying the file first. The file, if it exists, must have the same type as typeName. fileName and typeName are normal zero-terminated C strings (i.e. you do not have to tokenize them).
mode is the given mode to be checked. This parameter can either be FM_READ_ACCESS or FM_WRITE_ACCESS.
typeName is a string which gives the type of the file to open. typeName is a normal-zero terminated C string which must contain one to four characters.
The value returned by FAccess is one of the following, as described in the FileStatusEnum enum:

FS_OK | The file can be opened in the given mode.
FS_ERROR | The file cannot be opened for the specified mode. (It may be locked or not of custom (OTH) data-type.)
FS_NOT_FOUND | fileName does not exist.
FS_BAD_NAME | fileName is invalid.

Uses: FOpen

See also: FOpen, FCreate