#include <revolution/vf.h>
typedef void VFFile;
VFFile* VFOpenFile( const char* path, const char* mode, u32 attr );
VFFile* VFOpenFileW( const VFWchar* path, const VFWchar* mode, u32 attr );
path |
The address storing the path and file name. Either a full or relative path may be specified. |
mode |
The permitted access mode. |
attr |
Specifies the file attributes. (Not currently used.) To assure future compatibility, always specify 0. |
Pointer for the file descriptor.
NULL is returned if the function fails.
You can get details about the error using VFGetLastError.
Opens a file.
The following access modes can be specified as the string for mode, the second argument.
"r" |
Opens in read mode. |
"w" |
Opens a blank file in write mode. When the specified file already exists, the previous file's content is destroyed. |
"a" |
Opens a file in append mode (where writes occur at the end of the file). If the file doesn't exist, it is created. |
"r+" |
Opens a file in read/write mode. If the file doesn't exist, an error occurs. |
"w+" |
Opens a blank file in read/write mode. When the specified file already exists, the previous file's content is destroyed. |
"a+" |
Opens a file in read/append mode. If the file doesn't exist. it is created. |
VFCreateFile, VFSeekFile, VFReadFile, VFWriteFile, VFCloseFile, VFDeleteFile
2006/06/23
2007/05/08 Added description of Return Values.
CONFIDENTIAL