Cafe SDK  Version 2.13
API References for nn Library Modules
 All Data Structures Namespaces Functions Variables Typedefs Enumerations Enumerator Groups Pages
Modules
Temporary Directory (TEMP) Library

Library for creating a temporary directory. More...

Modules

 Temporary Directory (TEMP) API
 A list of TEMP library members. (Includes only C API members.))
 
 Temporary Directory (TEMP) Status
 A list of Status values used in the TEMP library.
 

Detailed Description

Library for creating a temporary directory.

Overview

This library provides features that allow the application to use free space in system memory or USB storage to temporarily store data.

Restricting the Amount of Data

You can use all of the free space in storage as a temporary directory. However, if there is no free space at all, you cannot use this feature.
You must include a sequence that covers the case that there is no free space at all when using this feature.
You cannot link and use the free space in several different storage locations as a single temporary directory.

Sharing Data Between Processes

The "owner" process that creates a temporary directory can give other "referrer" processes access to any of the data in the directory.
You could use this feature to pass data from the game application to an overlay application, for example.
The owner process can also configure access permissions for specific files and subdirectories in the temporary directory independently.

Selecting Storage

The TEMP library determines which storage area to use when creating the temporary directory.
Have the application specify whether to prioritize access speed or the amount of free space when selecting a storage region to use when creating the temporary directory.
As a result, the application does not have to include handling for the possibility of the temporary directory being created in the wrong storage region.
The location of the temporary directory has nothing to do with the storage region where the application is installed or where the application's save data is saved.

Lifespan

The temporary directory exists only while the application is running, so the data is guaranteed not to exist at any other time.
The data in the transaction journal is also deleted.

Notes on Using the TEMP Library

Insufficient Free Space

Make sure that the application continues to run smoothly even if a temporary directory could not be created because there was insufficient free space.
The amount of free space in storage varies from user to user.
If insufficient free space is detected, you can either notify the user using the error viewer (see below) or allow the application to continue running without using the temporary directory feature.

High-Frequency Access to Storage Is Prohibited

Do not access the temporary directory with an extremely high frequency because it can decrease the lifespan of storage.
Be especially careful when leaving the temporary directory open continuously while the application is running. (For example, by continuously recording a gameplay video to the temporary directory.)
For more information about the acceptable range for storage access frequency, see the File System > Access Frequency section in the Wii U Guidelines.

Processes That Depend on Access Speed Are Prohibited

Do not implement processes that depend directly on the speed of access to storage.
The actual speed of access to the temporary directory varies depending on the type of storage device the user is using.
For more information about storage access speed, see the File System > Programs that Depend on Access Speed section in the Wii U Guidelines.

How to Report Errors to the Error Viewer

ERROR_CODE_TEMP_CREATE_STORAGE_FULL or 1660100

If there is an insufficient free space error when temporary data is created (TEMP_STATUS_STORAGE_FULL), either 1660100 or ERROR_CODE_TEMP_CREATE_STORAGE_FULL can be passed to the error viewer for display. This error can occur in the following situations.

ERROR_CODE_TEMP_MODIFY_STORAGE_FULL or 1660200

If there is an insufficient free space error when temporary data is updated (TEMP_STATUS_STORAGE_FULL), either 1660200 or ERROR_CODE_TEMP_MODIFY_STORAGE_FULL can be passed to the error viewer for display. This error can occur in the following situations.