TryRead

nn::fs::FileInputStream::TryRead Member Function

Syntax

virtual Result TryRead(
     s32 * pOut,
     void * buffer,
     size_t size
);

Parameters

Name Description
out pOut Stores the size of data (in bytes) that were actually copied. The value 0 is stored if the function reaches the end of the file.
in buffer Pointer to the buffer where the data will be copied.
in size Maximum number of bytes to copy.

Return Values

Returns the result of the operation.

Description

Reads 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.

Do not access the memory of the specified buffer region (neither reading nor writing) during this function call (for example, from another thread). File reads may be incorrect, and the program could stop working in a future version of the SDK.

Error handling will differ, depending on the archive. For details, see Handling Errors During File and Directory Operations.

Revision History

2011/03/18
Added note about limitations on buffer access during function call.
2010/12/22
Added a link to the error handling page.
2010/06/14
Initial version.

CONFIDENTIAL