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_OKThe file can be opened in the given mode.
FS_ERRORThe file cannot be opened for the specified mode. (It may be locked or not of custom (OTH) data-type.)
FS_NOT_FOUNDfileName does not exist.
FS_BAD_NAMEfileName is invalid.


Uses: FOpen


See also: FOpen, FCreate