Difference between revisions of "Bfile OpenFile OS"
From WikiPrizm
Jump to navigationJump to searchm |
|||
Line 24: | Line 24: | ||
| 4 || READWRITE_SHARE || Both readable and writable and cannot be modified by other add-ins (?) | | 4 || READWRITE_SHARE || Both readable and writable and cannot be modified by other add-ins (?) | ||
|} | |} | ||
+ | [[Category:Syscalls:Bfile]] |
Revision as of 20:59, 9 June 2012
Contents
Synopsis
Header: Not documented
Syscall index: Not documented
Function signature: int Bfile_OpenFile_OS(const unsigned short* filename, int mode);
Opens an existing file in storage memory.
Parameters
- filename: A 16 bit character array specifying the name of the desired file, most likely generated by Bfile_StrToName_ncpy.
- mode: The mode of which the file will be opened with. See #Modes.
Returns
A handle to the opened file, or a negative number on failure.
Comments
Unlike the standard library's fopen, this function returns with a file not found error if attempting to open a nonexistent file in write mode. Use Bfile_CreateEntry_OS to create a new file, then open it to write.
Modes
The following table enumerates the known modes which may be passed as the second parameter to this function.
Mode | Alias | Description |
---|---|---|
0 | READ | Read-only |
1 | READ_SHARE | Read-only and cannot be modified by other add-ins (?) |
2 | WRITE | Write-only |
3 | READWRITE | Both readable and writable |
4 | READWRITE_SHARE | Both readable and writable and cannot be modified by other add-ins (?) |