nn::fs::CreateExtSaveData Function

Syntax

Result CreateExtSaveData(
     nn::fs::ExtSaveDataId id,
     const void * iconData,
     size_t iconDataSize,
     u32 entryDirectory,
     u32 entryFile
);

Parameters

Name Description
in id Specifies the ID of the expanded save data.
in iconData Specifies icon data.
in iconDataSize Specifies the size of the icon data.
in entryDirectory Specifies the number of directories to be stored in this expanded save data region.
in entryFile Specifies the number of files to be stored in this expanded save data region.

Return Values

Returns the result of the operation.
Value Description
Result::IsSuccess Process was successful.
ResultMediaNotFound SD Card cannot be found or recognized.
ResultNotEnoughSpace The SD Card does not have the necessary free space.
ResultWriteProtected The SD Card is write-protected.
ResultMediaAccessError An error occurred while accessing the SD Card due to some cause such as a loose connection.
ResultNotFormatted The process of creating data was interrupted by an error. The same error is returned when a mount operation is attempted from this state.
ResultBadFormat The SD Card has an invalid format. You must format the SD Card.
A value other than the above. An application bug or some other unexpected error.

Description

Creates an expanded save data memory region.

Before calling this function, you must call the MountExtSaveData function and check if a memory region with this same ID has already been created. To format the region, call the DeleteExtSaveData function to delete, and then call this function.

For the icon data, specify the ICN file output by the ctr_makebanner32 tool.

Unless you re-create the expanded save data, writes cannot exceed the number of directories and number of files specified here. Be very careful during extended use.

You cannot change the size of files created in expanded save data memory. Consequently, you cannot create files using functions such as FileStream::TryInitialize. When creating files, use the TryCreateFile function, for which you can specify the file size.

About the Expanded Save Data ID

This function creates an expanded save data region corresponding to the id argument. For the expanded save data ID, specify the expanded save data number specified in the RSF file (the value specified by the ExtSaveDataNumber key name).
For details on RSF, see the ctr_makerom reference.

Revision History

2012/03/01
Deleted the text regarding the limit on data size.
2011/03/07
Deleted ResultArchiveInvalidated from the return values.
2011/02/21
Added a description of the expanded save data ID.
2011/01/05
Revised the description of ResultMediaAccessError.
2010/12/14
Added return values.
2010/11/09
Initial version.

CONFIDENTIAL