nn::fs::FormatSaveData Function

Syntax

Result FormatSaveData(
     size_t maxFiles,
     size_t maxDirectories,
     bool isDuplicateAll = false
);

Arguments

Name Description
in maxFiles Specifies the maximum number of files.
in maxDirectories Specifies the maximum number of directories.
in isDuplicateAll Specifies whether to duplicate the entire save data region.

Return Values

Returns the result of the operation.
Value Description
Result::IsSuccess Process was successful.
ResultNotEnoughSpace The values of maxFiles and maxDirectories are too large for save data. You must not allow this error to occur in retail products.
A value other than the above. An unexpected or fatal error occurred.

Description

Formats a save data region.

Formats an application-specific save data region. Calling this function will erase any save data that may have existed there.

When you format this save data region, you can specify the maximum number of files and directories that it can hold. Note that you cannot create any more than this number of files and directories.

When formatting with isDuplicateAll set to true, be sure to call the CommitSaveData function before unmounting the save data.

Note

When mounting save data, always be sure to unmount before formatting. Otherwise, the nn::fs::MountSaveData function will return success, but operations on the mounted archive are not guaranteed.

BackupMemoryType

If the value specified in BackupMemoryType via RSF differs from the actual size of the backup memory, then the backup memory size takes precedence. Even if 128 KB is the specified value in BackupMemoryType, when 512 KB of backup memory is being used, then it will format with a size of 512 KB. Formatting is still possible even if None is specified.
If you use a different backup memory size in development than in your product, manage available space with care.

If the value specified in BackupMemoryType differs from the size of the backup memory used in the product, it will cause an error in checking when the master ROM is submitted.

Revision History

2011/03/25
Added cautions about BackupMemoryType.
2011/02/07
Included a note about formatting when mounted.
2010/12/14
Added return values.
2010/08/16
Initial version.

CONFIDENTIAL