File System for Applications Overview

Table of Contents


File system services provide file access interface for following usage:

There are several interface libraries provided for those usage:

Library Description
FS General filesystem interface library. All file accesses other than save data are performed using this library.
SAVE Interface library specialized for save data access.

Application Data Directory

Application data directory is a read-only directory that contains all data resources of an application - executables, game data resources, and meta files for system (e.g. icon, manual, etc.). This is organized into three subdirectories:

Directory Description
code/ Executables (RPXs and RPLs) (accessed by system only).
meta/ Application metadata (accessed by system only).
content/ Data files and assets. (accessed by application only)

The application data structure is common in file system level whichever device the application is stored in.

The code/ and meta/ directories are not directly accessible from your application; they are accessed by the system only. The application can access content/ directory only.

Content Directory Location

To abstract which device the application lives, default mount point /vol/content/ is created at the root of content/ directory of your application. In the devkit environment, the /vol/content/ volume is emulated by the host PC.

/vol/content/ $CAFE_CONTENT_DIR $CAFE_ROOT/data/disc/content/ Application content data.

See Environment Settings MAN page for configuration of emulated directory.

General Rules For "Installable" Application

Applications can be installed and started from any (permitted) device, with no change to application code. There are some general rules so that application can live in every supported device:

Beginning with SDK version 2.11.04, these limitations are also defined as macros that you can refer to self-check your application in the codes:

#define FS_APPLICATION_DATA_FILE_SIZE_MAX          (4024*1024*1024)
If application data directory is emulated on host PC, the directory depth and the length of path under the "root" of application data may be more limited than described above. It depends on where the emulated directory is located in PC file tree. You will see an attention message on the debug output when you had a related error with emulated file access.

See Disc data structure for data layout on disc and related limitations.

Directory Configuration on Host PC

See Environment Settings MAN page.

Save Data Directory

Save data directory is a writable directory that contains application specific save data. See SAVE library introduction MAN page.

Host PC Data For Debug

With a certain emulation mode of devkit (CAT-DEV or CAT-R), developers can access anywhere on your host PC using Host File IO. See Environment Settings MAN page.

SD Card Usage For Development

SD cards may be used for development purposes only. If game developers want to use SD cards for production applications, they must obtain permission from Nintendo. Cafe SDK supports SD cards on the FS layer only as manually mounted devices. For information about mounting devices manually, see File System Overview. For information about see how to mount and access SD cards, see FS Demos.

To use an SD card, in the Application Config Tool, Storage Information, Storage Access, check Read and Write check boxes for SD cards, and then output a XML.

Without this setup, the application cannot recognize an SD card when it is inserted, and FSGetMountSource immediately returns FS_STATUS_END.

How To Log Each FS API

You can see FS logs by sending commands to COS shell via a USB serial cable. See here for more information.

Revision History

2014/02/04 Modified note about general rules for application data.
2013/09/06 Added note about how to log each FS API.
2013/06/20 Removed TBD information about using SD Card rules.
2013/05/08 Automated cleanup pass.
2013/04/23 Added note about SD Card usage for development.
2012/07/27 Removed FSA information.
2012/05/16 Added SD Card usage for development.
2012/04/11 Initial version. Moved information from other pages.