# mfsHFopen

Format: s32 mfsHFopen(MfsFile* handle, u8* path, u16 mode)

Arguments: *handle Pointer for storing file handle pointer

    *path	File pathname
    mode	Mode for opening file

Return value:Error

Function:Opens file

Description: This function opens the file specified by path and sets the file handle pointer to handle.

"path" specifies the file name and its path with a character string. The maximum length of the character string is 128 characters including the terminating NULL.

The following access modes can be specified for mode.

    MFS_OPEN_READ	0x0001 Read
    MFS_OPEN_WRITE	0x0002 Write
    MFS_OPEN_UPDATE	0x0000 Update
    MFS_OPEN_APPEND	0x0010 Append
    MFS_OPEN_CREATE	0x0020 Create

MFS_OPEN_READ and MFS_OPEN_WRITE can be specified at the same time.
When MFS_OPEN_WRITE is specified, MFS_OPEN_APPEND can be specified.
When MFS_OPEN_APPEND is not specified, MFS_OPEN_UPDATE is assumed.
When MFS_OPEN_UPDATE is used, the existing file contents are lost.
When only MFS_OPEN_READ is specified, the MFS_OPEN_UPDATE and MFS_OPEN_APPEND specifications are ineffective.

Main errors:

    MFS_ERR_NO		Normal termination
    MFS_ERR_FATAL		File cannot be opened
    			There is no free file handle.
    MFS_ERR_NOTFOUND	File not found
    			The file was not found, or the directory was not found.
    MFS_ERR_NAME 		File name error
    			The pathname does not contain a file name, or there is no extension.
    MFS_ERR_REFUSE 		Illegal operation
    			A ROM area was opened in write mode.