Difference between revisions of "Bfile ReadFile OS"

From WikiPrizm
Jump to navigationJump to search
(Created page with "{{syscall | name = Bfile_ReadFile_OS | index = 0x1DAC | signature = int Bfile_ReadFile_OS(int handle, void *buf, int size, int pos) | synopsis = Reads bytes from an open file....")
 
Line 1: Line 1:
 +
{{preliminary}}
 
{{syscall
 
{{syscall
 
| name = Bfile_ReadFile_OS
 
| name = Bfile_ReadFile_OS
Line 8: Line 9:
 
* '''buf''': Location to store data read from file.
 
* '''buf''': Location to store data read from file.
 
* '''size''': Number of bytes to read.
 
* '''size''': Number of bytes to read.
* '''pos''': Unknown.  Pass as zero.
+
* '''pos''': File offset to read at, or -1 to read from the current file pointer (like stdio).
| returns = Unknown.  Possibly the number of bytes read, which may indicate an error if it differs from the value input as ''size''.
+
| returns = Number of bytes read, or a negative error code on failure.
 
| comments = Large values for ''size'' (one megabyte or more) may cause issues (hang the calculator).
 
| comments = Large values for ''size'' (one megabyte or more) may cause issues (hang the calculator).
 
}}
 
}}

Revision as of 21:09, 9 June 2012

This page's documentation is not complete and is based off of preliminary testing. There may be errors in the documentation or the naming conventions may not be completely agreed upon.


Synopsis

Header: Not documented
Syscall index: 0x1DAC
Function signature: int Bfile_ReadFile_OS(int handle, void *buf, int size, int pos)

Reads bytes from an open file.

Parameters

  • handle: File handle as returned by Bfile_OpenFile_OS.
  • buf: Location to store data read from file.
  • size: Number of bytes to read.
  • pos: File offset to read at, or -1 to read from the current file pointer (like stdio).

Returns

Number of bytes read, or a negative error code on failure.

Comments

Large values for size (one megabyte or more) may cause issues (hang the calculator).