nn::fs::FileStream::Read Member Function

Syntax

virtual s32 Read(
     void * buffer,
     size_t size
);

Arguments

Name Description
in buffer Pointer to the buffer where the data will be copied.
in size Maximum number of bytes to copy.

Return Values

Returns the actual number of bytes that were copied. Returns 0 if it reached the end of the file.

Description

Loads the specified amount of data from a file into a buffer.

Up to size bytes of data are read from the current file position and copied to the region at the address specified by buffer.

This function is implemented to show an error screen when errors occur internally, whether or not such errors are fatal. Control does not return from the function in this case. Use nn::fs::FileStream::TryRead on everything other than ROM archives.

To read details about error handling, see Handling Errors During File and Directory Operations.

Revision History

2010/12/24
Added a link to the error handling page.
2010/01/29
Initial version.

CONFIDENTIAL