GetSdmcSize

nn::fs::GetSdmcSize Function

Syntax

Result GetSdmcSize(
     s64 * pTotal,
     s64 * pFree
);

Parameters

Name Description
out pTotal Returns the total SD Card capacity.
out pFree Returns the amount of free space on the SD Card.

Return Values

Returns the result of the operation.
Value Description
Result::IsSuccess Process was successful.
ResultNotFound An SD Card could not be found or recognized. This error will also be returned if an SD Card is inserted but the file system on the card cannot be accessed.
A value other than the above. An application bug or some other unexpected error.

Description

Gets the total capacity and amount of free space on an SD Card.

Note

The Function Reference for CTR-SDK 0.14.16 and prior versions stated that this function returns the errors ResultMediaNotFound, ResultMediaAccessError, and ResultBadFormat. The actual error returned by the function is only ResultNotFound.

This function will return ResultNotFound if it is called when there is no SD Card as well as when there is no archive mounted on the SD Card. This is a limitation of this function. To avoid this limitation, call this function after first calling either the nn::fs::MountSdmc, nn::fs::MountSdmcWriteOnly or nn::fs::MountExtSaveData function.

Revision History

2010/12/28
Added mention of a limitation.
Corrected Result to only be ResultNotFound.
2010/12/15
Added return values.
2010/11/25
Initial version.

CONFIDENTIAL