libctru  v2.4.1
Data Structures | Typedefs | Enumerations | Functions
fs.h File Reference

Filesystem Services. More...

#include <3ds/types.h>

Go to the source code of this file.

Data Structures

struct  FS_DirectoryEntry
 Directory entry. More...
 
struct  FS_ArchiveResource
 Archive resource information. More...
 
struct  FS_ProgramInfo
 Program information. More...
 
struct  FS_ProductInfo
 Product information. More...
 
struct  FS_IntegrityVerificationSeed
 Integrity verification seed. More...
 
struct  FS_ExtSaveDataInfo
 Ext save data information. More...
 
struct  FS_SystemSaveDataInfo
 System save data information. More...
 
struct  FS_DeviceMoveContext
 Device move context. More...
 
struct  FS_Path
 Filesystem path data, detailing the specific target of an operation. More...
 
struct  FS_SdMmcSpeedInfo
 SDMC/NAND speed information. More...
 

Typedefs

typedef u64 FS_Archive
 Filesystem archive handle, providing access to a filesystem's contents.
 

Enumerations

enum  {
  FS_OPEN_READ = BIT(0) ,
  FS_OPEN_WRITE = BIT(1) ,
  FS_OPEN_CREATE = BIT(2)
}
 Open flags. More...
 
enum  {
  FS_WRITE_FLUSH = BIT(0) ,
  FS_WRITE_UPDATE_TIME = BIT(8)
}
 Write flags. More...
 
enum  {
  FS_ATTRIBUTE_DIRECTORY = BIT(0) ,
  FS_ATTRIBUTE_HIDDEN = BIT(8) ,
  FS_ATTRIBUTE_ARCHIVE = BIT(16) ,
  FS_ATTRIBUTE_READ_ONLY = BIT(24)
}
 Attribute flags. More...
 
enum  FS_MediaType {
  MEDIATYPE_NAND = 0 ,
  MEDIATYPE_SD = 1 ,
  MEDIATYPE_GAME_CARD = 2
}
 Media types. More...
 
enum  FS_SystemMediaType {
  SYSTEM_MEDIATYPE_CTR_NAND = 0 ,
  SYSTEM_MEDIATYPE_TWL_NAND = 1 ,
  SYSTEM_MEDIATYPE_SD = 2 ,
  SYSTEM_MEDIATYPE_TWL_PHOTO = 3
}
 System media types. More...
 
enum  FS_ArchiveID {
  ARCHIVE_ROMFS = 0x00000003 ,
  ARCHIVE_SAVEDATA = 0x00000004 ,
  ARCHIVE_EXTDATA = 0x00000006 ,
  ARCHIVE_SHARED_EXTDATA = 0x00000007 ,
  ARCHIVE_SYSTEM_SAVEDATA = 0x00000008 ,
  ARCHIVE_SDMC = 0x00000009 ,
  ARCHIVE_SDMC_WRITE_ONLY = 0x0000000A ,
  ARCHIVE_BOSS_EXTDATA = 0x12345678 ,
  ARCHIVE_CARD_SPIFS = 0x12345679 ,
  ARCHIVE_EXTDATA_AND_BOSS_EXTDATA = 0x1234567B ,
  ARCHIVE_SYSTEM_SAVEDATA2 = 0x1234567C ,
  ARCHIVE_NAND_RW = 0x1234567D ,
  ARCHIVE_NAND_RO = 0x1234567E ,
  ARCHIVE_NAND_RO_WRITE_ACCESS = 0x1234567F ,
  ARCHIVE_SAVEDATA_AND_CONTENT = 0x2345678A ,
  ARCHIVE_SAVEDATA_AND_CONTENT2 = 0x2345678E ,
  ARCHIVE_NAND_CTR_FS = 0x567890AB ,
  ARCHIVE_TWL_PHOTO = 0x567890AC ,
  ARCHIVE_TWL_SOUND = 0x567890AD ,
  ARCHIVE_NAND_TWL_FS = 0x567890AE ,
  ARCHIVE_NAND_W_FS = 0x567890AF ,
  ARCHIVE_GAMECARD_SAVEDATA = 0x567890B1 ,
  ARCHIVE_USER_SAVEDATA = 0x567890B2 ,
  ARCHIVE_DEMO_SAVEDATA = 0x567890B4
}
 Archive IDs. More...
 
enum  FS_PathType {
  PATH_INVALID = 0 ,
  PATH_EMPTY = 1 ,
  PATH_BINARY = 2 ,
  PATH_ASCII = 3 ,
  PATH_UTF16 = 4
}
 Path types. More...
 
enum  FS_SecureValueSlot { SECUREVALUE_SLOT_SD = 0x1000 }
 Secure value slot. More...
 
enum  FS_CardSpiBaudRate {
  BAUDRATE_512KHZ = 0 ,
  BAUDRATE_1MHZ = 1 ,
  BAUDRATE_2MHZ = 2 ,
  BAUDRATE_4MHZ = 3 ,
  BAUDRATE_8MHZ = 4 ,
  BAUDRATE_16MHZ = 5
}
 Card SPI baud rate. More...
 
enum  FS_CardSpiBusMode {
  BUSMODE_1BIT = 0 ,
  BUSMODE_4BIT = 1
}
 Card SPI bus mode. More...
 
enum  FS_SpecialContentType {
  SPECIALCONTENT_UPDATE = 1 ,
  SPECIALCONTENT_MANUAL = 2 ,
  SPECIALCONTENT_DLP_CHILD = 3
}
 Card SPI bus mode. More...
 
enum  FS_CardType {
  CARD_CTR = 0 ,
  CARD_TWL = 1
}
 
enum  FS_Action { FS_ACTION_UNKNOWN = 0 }
 FS control actions.
 
enum  FS_ArchiveAction {
  ARCHIVE_ACTION_COMMIT_SAVE_DATA = 0 ,
  ARCHIVE_ACTION_GET_TIMESTAMP = 1 ,
  ARCHIVE_ACTION_UNKNOWN = 0x789D
}
 Archive control actions. More...
 
enum  FS_SecureSaveAction {
  SECURESAVE_ACTION_DELETE = 0 ,
  SECURESAVE_ACTION_FORMAT = 1
}
 Secure save control actions. More...
 
enum  FS_FileAction { FILE_ACTION_UNKNOWN = 0 }
 File control actions.
 
enum  FS_DirectoryAction { DIRECTORY_ACTION_UNKNOWN = 0 }
 Directory control actions.
 

Functions

Result fsInit (void)
 Initializes FS.
 
void fsExit (void)
 Exits FS.
 
void fsUseSession (Handle session)
 Sets the FSUSER session to use in the current thread. More...
 
void fsEndUseSession (void)
 Disables the FSUSER session override in the current thread.
 
void fsExemptFromSession (FS_Archive archive)
 Exempts an archive from using alternate FS session handles provided with fsUseSession Instead, the archive will use the default FS session handle, opened with srvGetSessionHandle. More...
 
void fsUnexemptFromSession (FS_Archive archive)
 Unexempts an archive from using alternate FS session handles provided with fsUseSession. More...
 
FS_Path fsMakePath (FS_PathType type, const void *path)
 Creates an FS_Path instance. More...
 
HandlefsGetSessionHandle (void)
 Gets the current FS session handle. More...
 
Result FSUSER_Control (FS_Action action, void *input, u32 inputSize, void *output, u32 outputSize)
 Performs a control operation on the filesystem. More...
 
Result FSUSER_Initialize (Handle session)
 Initializes a FSUSER session. More...
 
Result FSUSER_OpenFile (Handle *out, FS_Archive archive, FS_Path path, u32 openFlags, u32 attributes)
 Opens a file. More...
 
Result FSUSER_OpenFileDirectly (Handle *out, FS_ArchiveID archiveId, FS_Path archivePath, FS_Path filePath, u32 openFlags, u32 attributes)
 Opens a file directly, bypassing the requirement of an opened archive handle. More...
 
Result FSUSER_DeleteFile (FS_Archive archive, FS_Path path)
 Deletes a file. More...
 
Result FSUSER_RenameFile (FS_Archive srcArchive, FS_Path srcPath, FS_Archive dstArchive, FS_Path dstPath)
 Renames a file. More...
 
Result FSUSER_DeleteDirectory (FS_Archive archive, FS_Path path)
 Deletes a directory, failing if it is not empty. More...
 
Result FSUSER_DeleteDirectoryRecursively (FS_Archive archive, FS_Path path)
 Deletes a directory, also deleting its contents. More...
 
Result FSUSER_CreateFile (FS_Archive archive, FS_Path path, u32 attributes, u64 fileSize)
 Creates a file. More...
 
Result FSUSER_CreateDirectory (FS_Archive archive, FS_Path path, u32 attributes)
 Creates a directory. More...
 
Result FSUSER_RenameDirectory (FS_Archive srcArchive, FS_Path srcPath, FS_Archive dstArchive, FS_Path dstPath)
 Renames a directory. More...
 
Result FSUSER_OpenDirectory (Handle *out, FS_Archive archive, FS_Path path)
 Opens a directory. More...
 
Result FSUSER_OpenArchive (FS_Archive *archive, FS_ArchiveID id, FS_Path path)
 Opens an archive. More...
 
Result FSUSER_ControlArchive (FS_Archive archive, FS_ArchiveAction action, void *input, u32 inputSize, void *output, u32 outputSize)
 Performs a control operation on an archive. More...
 
Result FSUSER_CloseArchive (FS_Archive archive)
 Closes an archive. More...
 
Result FSUSER_GetFreeBytes (u64 *freeBytes, FS_Archive archive)
 Gets the number of free bytes within an archive. More...
 
Result FSUSER_GetCardType (FS_CardType *type)
 Gets the inserted card type. More...
 
Result FSUSER_GetSdmcArchiveResource (FS_ArchiveResource *archiveResource)
 Gets the SDMC archive resource information. More...
 
Result FSUSER_GetNandArchiveResource (FS_ArchiveResource *archiveResource)
 Gets the NAND archive resource information. More...
 
Result FSUSER_GetSdmcFatfsError (u32 *error)
 Gets the last SDMC fatfs error. More...
 
Result FSUSER_IsSdmcDetected (bool *detected)
 Gets whether an SD card is detected. More...
 
Result FSUSER_IsSdmcWritable (bool *writable)
 Gets whether the SD card is writable. More...
 
Result FSUSER_GetSdmcCid (u8 *out, u32 length)
 Gets the SDMC CID. More...
 
Result FSUSER_GetNandCid (u8 *out, u32 length)
 Gets the NAND CID. More...
 
Result FSUSER_GetSdmcSpeedInfo (FS_SdMmcSpeedInfo *speedInfo)
 Gets the SDMC speed info. More...
 
Result FSUSER_GetNandSpeedInfo (FS_SdMmcSpeedInfo *speedInfo)
 Gets the NAND speed info. More...
 
Result FSUSER_GetSdmcLog (u8 *out, u32 length)
 Gets the SDMC log. More...
 
Result FSUSER_GetNandLog (u8 *out, u32 length)
 Gets the NAND log. More...
 
Result FSUSER_ClearSdmcLog (void)
 Clears the SDMC log.
 
Result FSUSER_ClearNandLog (void)
 Clears the NAND log.
 
Result FSUSER_CardSlotIsInserted (bool *inserted)
 Gets whether a card is inserted. More...
 
Result FSUSER_CardSlotPowerOn (bool *status)
 Powers on the card slot. More...
 
Result FSUSER_CardSlotPowerOff (bool *status)
 Powers off the card slot. More...
 
Result FSUSER_CardSlotGetCardIFPowerStatus (bool *status)
 Gets the card's power status. More...
 
Result FSUSER_CardNorDirectCommand (u8 commandId)
 Executes a CARDNOR direct command. More...
 
Result FSUSER_CardNorDirectCommandWithAddress (u8 commandId, u32 address)
 Executes a CARDNOR direct command with an address. More...
 
Result FSUSER_CardNorDirectRead (u8 commandId, u32 size, void *output)
 Executes a CARDNOR direct read. More...
 
Result FSUSER_CardNorDirectReadWithAddress (u8 commandId, u32 address, u32 size, void *output)
 Executes a CARDNOR direct read with an address. More...
 
Result FSUSER_CardNorDirectWrite (u8 commandId, u32 size, const void *input)
 Executes a CARDNOR direct write. More...
 
Result FSUSER_CardNorDirectWriteWithAddress (u8 commandId, u32 address, u32 size, const void *input)
 Executes a CARDNOR direct write with an address. More...
 
Result FSUSER_CardNorDirectRead_4xIO (u8 commandId, u32 address, u32 size, void *output)
 Executes a CARDNOR 4xIO direct read. More...
 
Result FSUSER_CardNorDirectCpuWriteWithoutVerify (u32 address, u32 size, const void *input)
 Executes a CARDNOR direct CPU write without verify. More...
 
Result FSUSER_CardNorDirectSectorEraseWithoutVerify (u32 address)
 Executes a CARDNOR direct sector erase without verify. More...
 
Result FSUSER_GetProductInfo (FS_ProductInfo *info, u32 processId)
 Gets a process's product info. More...
 
Result FSUSER_GetProgramLaunchInfo (FS_ProgramInfo *info, u32 processId)
 Gets a process's program launch info. More...
 
Result FSUSER_SetCardSpiBaudRate (FS_CardSpiBaudRate baudRate)
 Sets the CARDSPI baud rate. More...
 
Result FSUSER_SetCardSpiBusMode (FS_CardSpiBusMode busMode)
 Sets the CARDSPI bus mode. More...
 
Result FSUSER_SendInitializeInfoTo9 (void)
 Sends initialization info to ARM9.
 
Result FSUSER_GetSpecialContentIndex (u16 *index, FS_MediaType mediaType, u64 programId, FS_SpecialContentType type)
 Gets a special content's index. More...
 
Result FSUSER_GetLegacyRomHeader (FS_MediaType mediaType, u64 programId, void *header)
 Gets the legacy ROM header of a program. More...
 
Result FSUSER_GetLegacyBannerData (FS_MediaType mediaType, u64 programId, void *banner)
 Gets the legacy banner data of a program. More...
 
Result FSUSER_CheckAuthorityToAccessExtSaveData (bool *access, FS_MediaType mediaType, u64 saveId, u32 processId)
 Checks a process's authority to access a save data archive. More...
 
Result FSUSER_QueryTotalQuotaSize (u64 *quotaSize, u32 directories, u32 files, u32 fileSizeCount, u64 *fileSizes)
 Queries the total quota size of a save data archive. More...
 
Result FSUSER_AbnegateAccessRight (u32 accessRight)
 Abnegates an access right. More...
 
Result FSUSER_DeleteSdmcRoot (void)
 Deletes the 3DS SDMC root.
 
Result FSUSER_DeleteAllExtSaveDataOnNand (void)
 Deletes all ext save data on the NAND.
 
Result FSUSER_InitializeCtrFileSystem (void)
 Initializes the CTR file system.
 
Result FSUSER_CreateSeed (void)
 Creates the FS seed.
 
Result FSUSER_GetFormatInfo (u32 *totalSize, u32 *directories, u32 *files, bool *duplicateData, FS_ArchiveID archiveId, FS_Path path)
 Retrieves archive format info. More...
 
Result FSUSER_GetLegacyRomHeader2 (u32 headerSize, FS_MediaType mediaType, u64 programId, void *header)
 Gets the legacy ROM header of a program. More...
 
Result FSUSER_GetSdmcCtrRootPath (u8 *out, u32 length)
 Gets the CTR SDMC root path. More...
 
Result FSUSER_GetArchiveResource (FS_ArchiveResource *archiveResource, FS_SystemMediaType mediaType)
 Gets an archive's resource information. More...
 
Result FSUSER_ExportIntegrityVerificationSeed (FS_IntegrityVerificationSeed *seed)
 Exports the integrity verification seed. More...
 
Result FSUSER_ImportIntegrityVerificationSeed (FS_IntegrityVerificationSeed *seed)
 Imports an integrity verification seed. More...
 
Result FSUSER_FormatSaveData (FS_ArchiveID archiveId, FS_Path path, u32 blocks, u32 directories, u32 files, u32 directoryBuckets, u32 fileBuckets, bool duplicateData)
 Formats save data. More...
 
Result FSUSER_GetLegacySubBannerData (u32 bannerSize, FS_MediaType mediaType, u64 programId, void *banner)
 Gets the legacy sub banner data of a program. More...
 
Result FSUSER_UpdateSha256Context (const void *data, u32 inputSize, u8 *hash)
 Hashes the given data and outputs a SHA256 hash. More...
 
Result FSUSER_ReadSpecialFile (u32 *bytesRead, u64 fileOffset, u32 size, void *data)
 Reads from a special file. More...
 
Result FSUSER_GetSpecialFileSize (u64 *fileSize)
 Gets the size of a special file. More...
 
Result FSUSER_CreateExtSaveData (FS_ExtSaveDataInfo info, u32 directories, u32 files, u64 sizeLimit, u32 smdhSize, u8 *smdh)
 Creates ext save data. More...
 
Result FSUSER_DeleteExtSaveData (FS_ExtSaveDataInfo info)
 Deletes ext save data. More...
 
Result FSUSER_ReadExtSaveDataIcon (u32 *bytesRead, FS_ExtSaveDataInfo info, u32 smdhSize, u8 *smdh)
 Reads the SMDH icon of ext save data. More...
 
Result FSUSER_GetExtDataBlockSize (u64 *totalBlocks, u64 *freeBlocks, u32 *blockSize, FS_ExtSaveDataInfo info)
 Gets an ext data archive's block information. More...
 
Result FSUSER_EnumerateExtSaveData (u32 *idsWritten, u32 idsSize, FS_MediaType mediaType, u32 idSize, bool shared, u8 *ids)
 Enumerates ext save data. More...
 
Result FSUSER_CreateSystemSaveData (FS_SystemSaveDataInfo info, u32 totalSize, u32 blockSize, u32 directories, u32 files, u32 directoryBuckets, u32 fileBuckets, bool duplicateData)
 Creates system save data. More...
 
Result FSUSER_DeleteSystemSaveData (FS_SystemSaveDataInfo info)
 Deletes system save data. More...
 
Result FSUSER_StartDeviceMoveAsSource (FS_DeviceMoveContext *context)
 Initiates a device move as the source device. More...
 
Result FSUSER_StartDeviceMoveAsDestination (FS_DeviceMoveContext context, bool clear)
 Initiates a device move as the destination device. More...
 
Result FSUSER_SetArchivePriority (FS_Archive archive, u32 priority)
 Sets an archive's priority. More...
 
Result FSUSER_GetArchivePriority (u32 *priority, FS_Archive archive)
 Gets an archive's priority. More...
 
Result FSUSER_SetCtrCardLatencyParameter (u64 latency, bool emulateEndurance)
 Configures CTRCARD latency emulation. More...
 
Result FSUSER_SwitchCleanupInvalidSaveData (bool enable)
 Toggles cleaning up invalid save data. More...
 
Result FSUSER_EnumerateSystemSaveData (u32 *idsWritten, u32 idsSize, u32 *ids)
 Enumerates system save data. More...
 
Result FSUSER_InitializeWithSdkVersion (Handle session, u32 version)
 Initializes a FSUSER session with an SDK version. More...
 
Result FSUSER_SetPriority (u32 priority)
 Sets the file system priority. More...
 
Result FSUSER_GetPriority (u32 *priority)
 Gets the file system priority. More...
 
Result FSUSER_SetSaveDataSecureValue (u64 value, FS_SecureValueSlot slot, u32 titleUniqueId, u8 titleVariation)
 Sets the save data secure value. More...
 
Result FSUSER_GetSaveDataSecureValue (bool *exists, u64 *value, FS_SecureValueSlot slot, u32 titleUniqueId, u8 titleVariation)
 Gets the save data secure value. More...
 
Result FSUSER_ControlSecureSave (FS_SecureSaveAction action, void *input, u32 inputSize, void *output, u32 outputSize)
 Performs a control operation on a secure save. More...
 
Result FSUSER_GetMediaType (FS_MediaType *mediaType)
 Gets the media type of the current application. More...
 
Result FSFILE_Control (Handle handle, FS_FileAction action, void *input, u32 inputSize, void *output, u32 outputSize)
 Performs a control operation on a file. More...
 
Result FSFILE_OpenSubFile (Handle handle, Handle *subFile, u64 offset, u64 size)
 Opens a handle to a sub-section of a file. More...
 
Result FSFILE_Read (Handle handle, u32 *bytesRead, u64 offset, void *buffer, u32 size)
 Reads from a file. More...
 
Result FSFILE_Write (Handle handle, u32 *bytesWritten, u64 offset, const void *buffer, u32 size, u32 flags)
 Writes to a file. More...
 
Result FSFILE_GetSize (Handle handle, u64 *size)
 Gets the size of a file. More...
 
Result FSFILE_SetSize (Handle handle, u64 size)
 Sets the size of a file. More...
 
Result FSFILE_GetAttributes (Handle handle, u32 *attributes)
 Gets the attributes of a file. More...
 
Result FSFILE_SetAttributes (Handle handle, u32 attributes)
 Sets the attributes of a file. More...
 
Result FSFILE_Close (Handle handle)
 Closes a file. More...
 
Result FSFILE_Flush (Handle handle)
 Flushes a file's contents. More...
 
Result FSFILE_SetPriority (Handle handle, u32 priority)
 Sets a file's priority. More...
 
Result FSFILE_GetPriority (Handle handle, u32 *priority)
 Gets a file's priority. More...
 
Result FSFILE_OpenLinkFile (Handle handle, Handle *linkFile)
 Opens a duplicate handle to a file. More...
 
Result FSDIR_Control (Handle handle, FS_DirectoryAction action, void *input, u32 inputSize, void *output, u32 outputSize)
 Performs a control operation on a directory. More...
 
Result FSDIR_Read (Handle handle, u32 *entriesRead, u32 entryCount, FS_DirectoryEntry *entries)
 Reads one or more directory entries. More...
 
Result FSDIR_Close (Handle handle)
 Closes a directory. More...
 
Result FSDIR_SetPriority (Handle handle, u32 priority)
 Sets a directory's priority. More...
 
Result FSDIR_GetPriority (Handle handle, u32 *priority)
 Gets a directory's priority. More...
 

Detailed Description

Filesystem Services.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Open flags.

Enumerator
FS_OPEN_READ 

Open for reading.

FS_OPEN_WRITE 

Open for writing.

FS_OPEN_CREATE 

Create file.

◆ anonymous enum

anonymous enum

Write flags.

Enumerator
FS_WRITE_FLUSH 

Flush.

FS_WRITE_UPDATE_TIME 

Update file timestamp.

◆ anonymous enum

anonymous enum

Attribute flags.

Enumerator
FS_ATTRIBUTE_DIRECTORY 

Directory.

FS_ATTRIBUTE_HIDDEN 

Hidden.

FS_ATTRIBUTE_ARCHIVE 

Archive.

FS_ATTRIBUTE_READ_ONLY 

Read-only.

◆ FS_ArchiveAction

Archive control actions.

Enumerator
ARCHIVE_ACTION_COMMIT_SAVE_DATA 

Commits save data changes. No inputs/outputs.

ARCHIVE_ACTION_GET_TIMESTAMP 

Retrieves a file's last-modified timestamp. In: "u16*, UTF-16 Path", Out: "u64, Time Stamp".

◆ FS_ArchiveID

Archive IDs.

Enumerator
ARCHIVE_ROMFS 

RomFS archive.

ARCHIVE_SAVEDATA 

Save data archive.

ARCHIVE_EXTDATA 

Ext data archive.

ARCHIVE_SHARED_EXTDATA 

Shared ext data archive.

ARCHIVE_SYSTEM_SAVEDATA 

System save data archive.

ARCHIVE_SDMC 

SDMC archive.

ARCHIVE_SDMC_WRITE_ONLY 

Write-only SDMC archive.

ARCHIVE_BOSS_EXTDATA 

BOSS ext data archive.

ARCHIVE_CARD_SPIFS 

Card SPI FS archive.

ARCHIVE_EXTDATA_AND_BOSS_EXTDATA 

Ext data and BOSS ext data archive.

ARCHIVE_SYSTEM_SAVEDATA2 

System save data archive.

ARCHIVE_NAND_RW 

Read-write NAND archive.

ARCHIVE_NAND_RO 

Read-only NAND archive.

ARCHIVE_NAND_RO_WRITE_ACCESS 

Read-only write access NAND archive.

ARCHIVE_SAVEDATA_AND_CONTENT 

User save data and ExeFS/RomFS archive.

ARCHIVE_SAVEDATA_AND_CONTENT2 

User save data and ExeFS/RomFS archive (only ExeFS for fs:LDR).

ARCHIVE_NAND_CTR_FS 

NAND CTR FS archive.

ARCHIVE_TWL_PHOTO 

TWL PHOTO archive.

ARCHIVE_TWL_SOUND 

TWL SOUND archive.

ARCHIVE_NAND_TWL_FS 

NAND TWL FS archive.

ARCHIVE_NAND_W_FS 

NAND W FS archive.

ARCHIVE_GAMECARD_SAVEDATA 

Game card save data archive.

ARCHIVE_USER_SAVEDATA 

User save data archive.

ARCHIVE_DEMO_SAVEDATA 

Demo save data archive.

◆ FS_CardSpiBaudRate

Card SPI baud rate.

Enumerator
BAUDRATE_512KHZ 

512KHz.

BAUDRATE_1MHZ 

1MHz.

BAUDRATE_2MHZ 

2MHz.

BAUDRATE_4MHZ 

4MHz.

BAUDRATE_8MHZ 

8MHz.

BAUDRATE_16MHZ 

16MHz.

◆ FS_CardSpiBusMode

Card SPI bus mode.

Enumerator
BUSMODE_1BIT 

1-bit.

BUSMODE_4BIT 

4-bit.

◆ FS_CardType

Enumerator
CARD_CTR 

CTR card.

CARD_TWL 

TWL card.

◆ FS_MediaType

Media types.

Enumerator
MEDIATYPE_NAND 

NAND.

MEDIATYPE_SD 

SD card.

MEDIATYPE_GAME_CARD 

Game card.

◆ FS_PathType

Path types.

Enumerator
PATH_INVALID 

Invalid path.

PATH_EMPTY 

Empty path.

PATH_BINARY 

Binary path. Meaning is per-archive.

PATH_ASCII 

ASCII text path.

PATH_UTF16 

UTF-16 text path.

◆ FS_SecureSaveAction

Secure save control actions.

Enumerator
SECURESAVE_ACTION_DELETE 

Deletes a save's secure value. In: "u64, ((SecureValueSlot << 32) | (TitleUniqueId << 8) | TitleVariation)", Out: "u8, Value Existed".

SECURESAVE_ACTION_FORMAT 

Formats a save. No inputs/outputs.

◆ FS_SecureValueSlot

Secure value slot.

Enumerator
SECUREVALUE_SLOT_SD 

SD application.

◆ FS_SpecialContentType

Card SPI bus mode.

Enumerator
SPECIALCONTENT_UPDATE 

Update.

SPECIALCONTENT_MANUAL 

Manual.

SPECIALCONTENT_DLP_CHILD 

DLP child.

◆ FS_SystemMediaType

System media types.

Enumerator
SYSTEM_MEDIATYPE_CTR_NAND 

CTR NAND.

SYSTEM_MEDIATYPE_TWL_NAND 

TWL NAND.

SYSTEM_MEDIATYPE_SD 

SD card.

SYSTEM_MEDIATYPE_TWL_PHOTO 

TWL Photo.

Function Documentation

◆ FSDIR_Close()

Result FSDIR_Close ( Handle  handle)

Closes a directory.

Parameters
handleHandle of the directory.

◆ FSDIR_Control()

Result FSDIR_Control ( Handle  handle,
FS_DirectoryAction  action,
void *  input,
u32  inputSize,
void *  output,
u32  outputSize 
)

Performs a control operation on a directory.

Parameters
handleHandle of the directory.
actionAction to perform.
inputBuffer to read input from.
inputSizeSize of the input.
outputBuffer to write output to.
outputSizeSize of the output.

◆ FSDIR_GetPriority()

Result FSDIR_GetPriority ( Handle  handle,
u32 priority 
)

Gets a directory's priority.

Parameters
handleHandle of the directory.
priorityPointer to output the priority to.

◆ FSDIR_Read()

Result FSDIR_Read ( Handle  handle,
u32 entriesRead,
u32  entryCount,
FS_DirectoryEntry entries 
)

Reads one or more directory entries.

Parameters
handleHandle of the directory.
entriesReadPointer to output the number of entries read to.
entryCountNumber of entries to read.
entryOutPointer to output directory entries to.

◆ FSDIR_SetPriority()

Result FSDIR_SetPriority ( Handle  handle,
u32  priority 
)

Sets a directory's priority.

Parameters
handleHandle of the directory.
priorityPriority to set.

◆ fsExemptFromSession()

void fsExemptFromSession ( FS_Archive  archive)

Exempts an archive from using alternate FS session handles provided with fsUseSession Instead, the archive will use the default FS session handle, opened with srvGetSessionHandle.

Parameters
archiveArchive to exempt.

◆ FSFILE_Close()

Result FSFILE_Close ( Handle  handle)

Closes a file.

Parameters
handleHandle of the file.

◆ FSFILE_Control()

Result FSFILE_Control ( Handle  handle,
FS_FileAction  action,
void *  input,
u32  inputSize,
void *  output,
u32  outputSize 
)

Performs a control operation on a file.

Parameters
handleHandle of the file.
actionAction to perform.
inputBuffer to read input from.
inputSizeSize of the input.
outputBuffer to write output to.
outputSizeSize of the output.

◆ FSFILE_Flush()

Result FSFILE_Flush ( Handle  handle)

Flushes a file's contents.

Parameters
handleHandle of the file.

◆ FSFILE_GetAttributes()

Result FSFILE_GetAttributes ( Handle  handle,
u32 attributes 
)

Gets the attributes of a file.

Parameters
handleHandle of the file.
attributesPointer to output the attributes to.

◆ FSFILE_GetPriority()

Result FSFILE_GetPriority ( Handle  handle,
u32 priority 
)

Gets a file's priority.

Parameters
handleHandle of the file.
priorityPointer to output the priority to.

◆ FSFILE_GetSize()

Result FSFILE_GetSize ( Handle  handle,
u64 size 
)

Gets the size of a file.

Parameters
handleHandle of the file.
sizePointer to output the size to.

◆ FSFILE_OpenLinkFile()

Result FSFILE_OpenLinkFile ( Handle  handle,
Handle linkFile 
)

Opens a duplicate handle to a file.

Parameters
handleHandle of the file.
linkFilePointer to output the link handle to.

◆ FSFILE_OpenSubFile()

Result FSFILE_OpenSubFile ( Handle  handle,
Handle subFile,
u64  offset,
u64  size 
)

Opens a handle to a sub-section of a file.

Parameters
handleHandle of the file.
subFilePointer to output the sub-file to.
offsetOffset of the sub-section.
sizeSize of the sub-section.

◆ FSFILE_Read()

Result FSFILE_Read ( Handle  handle,
u32 bytesRead,
u64  offset,
void *  buffer,
u32  size 
)

Reads from a file.

Parameters
handleHandle of the file.
bytesReadPointer to output the number of bytes read to.
offsetOffset to read from.
bufferBuffer to read to.
sizeSize of the buffer.

◆ FSFILE_SetAttributes()

Result FSFILE_SetAttributes ( Handle  handle,
u32  attributes 
)

Sets the attributes of a file.

Parameters
handleHandle of the file.
attributesAttributes to set.

◆ FSFILE_SetPriority()

Result FSFILE_SetPriority ( Handle  handle,
u32  priority 
)

Sets a file's priority.

Parameters
handleHandle of the file.
priorityPriority to set.

◆ FSFILE_SetSize()

Result FSFILE_SetSize ( Handle  handle,
u64  size 
)

Sets the size of a file.

Parameters
handleHandle of the file.
sizeSize to set.

◆ FSFILE_Write()

Result FSFILE_Write ( Handle  handle,
u32 bytesWritten,
u64  offset,
const void *  buffer,
u32  size,
u32  flags 
)

Writes to a file.

Parameters
handleHandle of the file.
bytesWrittenPointer to output the number of bytes written to.
offsetOffset to write to.
bufferBuffer to write from.
sizeSize of the buffer.
flagsFlags to use when writing.

◆ fsGetSessionHandle()

Handle* fsGetSessionHandle ( void  )

Gets the current FS session handle.

Returns
The current FS session handle.

◆ fsMakePath()

FS_Path fsMakePath ( FS_PathType  type,
const void *  path 
)

Creates an FS_Path instance.

Parameters
typeType of path.
pathPath to use.
Returns
The created FS_Path instance.

◆ fsUnexemptFromSession()

void fsUnexemptFromSession ( FS_Archive  archive)

Unexempts an archive from using alternate FS session handles provided with fsUseSession.

Parameters
archiveArchive to remove from the exemption list.

◆ FSUSER_AbnegateAccessRight()

Result FSUSER_AbnegateAccessRight ( u32  accessRight)

Abnegates an access right.

Parameters
accessRightAccess right to abnegate.

◆ FSUSER_CardNorDirectCommand()

Result FSUSER_CardNorDirectCommand ( u8  commandId)

Executes a CARDNOR direct command.

Parameters
commandIdID of the command.

◆ FSUSER_CardNorDirectCommandWithAddress()

Result FSUSER_CardNorDirectCommandWithAddress ( u8  commandId,
u32  address 
)

Executes a CARDNOR direct command with an address.

Parameters
commandIdID of the command.
addressAddress to provide.

◆ FSUSER_CardNorDirectCpuWriteWithoutVerify()

Result FSUSER_CardNorDirectCpuWriteWithoutVerify ( u32  address,
u32  size,
const void *  input 
)

Executes a CARDNOR direct CPU write without verify.

Parameters
addressAddress to provide.
sizeSize of the input buffer.
outputInput buffer.

◆ FSUSER_CardNorDirectRead()

Result FSUSER_CardNorDirectRead ( u8  commandId,
u32  size,
void *  output 
)

Executes a CARDNOR direct read.

Parameters
commandIdID of the command.
sizeSize of the output buffer.
outputOutput buffer.

◆ FSUSER_CardNorDirectRead_4xIO()

Result FSUSER_CardNorDirectRead_4xIO ( u8  commandId,
u32  address,
u32  size,
void *  output 
)

Executes a CARDNOR 4xIO direct read.

Parameters
commandIdID of the command.
addressAddress to provide.
sizeSize of the output buffer.
outputOutput buffer.

◆ FSUSER_CardNorDirectReadWithAddress()

Result FSUSER_CardNorDirectReadWithAddress ( u8  commandId,
u32  address,
u32  size,
void *  output 
)

Executes a CARDNOR direct read with an address.

Parameters
commandIdID of the command.
addressAddress to provide.
sizeSize of the output buffer.
outputOutput buffer.

◆ FSUSER_CardNorDirectSectorEraseWithoutVerify()

Result FSUSER_CardNorDirectSectorEraseWithoutVerify ( u32  address)

Executes a CARDNOR direct sector erase without verify.

Parameters
addressAddress to provide.

◆ FSUSER_CardNorDirectWrite()

Result FSUSER_CardNorDirectWrite ( u8  commandId,
u32  size,
const void *  input 
)

Executes a CARDNOR direct write.

Parameters
commandIdID of the command.
sizeSize of the input buffer.
outputInput buffer.

◆ FSUSER_CardNorDirectWriteWithAddress()

Result FSUSER_CardNorDirectWriteWithAddress ( u8  commandId,
u32  address,
u32  size,
const void *  input 
)

Executes a CARDNOR direct write with an address.

Parameters
commandIdID of the command.
addressAddress to provide.
sizeSize of the input buffer.
inputInput buffer.

◆ FSUSER_CardSlotGetCardIFPowerStatus()

Result FSUSER_CardSlotGetCardIFPowerStatus ( bool *  status)

Gets the card's power status.

Parameters
statusPointer to output the power status to.

◆ FSUSER_CardSlotIsInserted()

Result FSUSER_CardSlotIsInserted ( bool *  inserted)

Gets whether a card is inserted.

Parameters
insertedPointer to output the insertion status to.

◆ FSUSER_CardSlotPowerOff()

Result FSUSER_CardSlotPowerOff ( bool *  status)

Powers off the card slot.

Parameters
statusPointer to output the power status to.

◆ FSUSER_CardSlotPowerOn()

Result FSUSER_CardSlotPowerOn ( bool *  status)

Powers on the card slot.

Parameters
statusPointer to output the power status to.

◆ FSUSER_CheckAuthorityToAccessExtSaveData()

Result FSUSER_CheckAuthorityToAccessExtSaveData ( bool *  access,
FS_MediaType  mediaType,
u64  saveId,
u32  processId 
)

Checks a process's authority to access a save data archive.

Parameters
accessPointer to output the access status to.
mediaTypeMedia type of the save data.
saveIdID of the save data.
processIdID of the process to check.

◆ FSUSER_CloseArchive()

Result FSUSER_CloseArchive ( FS_Archive  archive)

Closes an archive.

Parameters
archiveArchive to close.

◆ FSUSER_Control()

Result FSUSER_Control ( FS_Action  action,
void *  input,
u32  inputSize,
void *  output,
u32  outputSize 
)

Performs a control operation on the filesystem.

Parameters
actionAction to perform.
inputBuffer to read input from.
inputSizeSize of the input.
outputBuffer to write output to.
outputSizeSize of the output.

◆ FSUSER_ControlArchive()

Result FSUSER_ControlArchive ( FS_Archive  archive,
FS_ArchiveAction  action,
void *  input,
u32  inputSize,
void *  output,
u32  outputSize 
)

Performs a control operation on an archive.

Parameters
archiveArchive to control.
actionAction to perform.
inputBuffer to read input from.
inputSizeSize of the input.
outputBuffer to write output to.
outputSizeSize of the output.

◆ FSUSER_ControlSecureSave()

Result FSUSER_ControlSecureSave ( FS_SecureSaveAction  action,
void *  input,
u32  inputSize,
void *  output,
u32  outputSize 
)

Performs a control operation on a secure save.

Parameters
actionAction to perform.
inputBuffer to read input from.
inputSizeSize of the input.
outputBuffer to write output to.
outputSizeSize of the output.

◆ FSUSER_CreateDirectory()

Result FSUSER_CreateDirectory ( FS_Archive  archive,
FS_Path  path,
u32  attributes 
)

Creates a directory.

Parameters
archiveArchive to create the directory in.
pathPath of the directory.
attributesAttributes of the directory.

◆ FSUSER_CreateExtSaveData()

Result FSUSER_CreateExtSaveData ( FS_ExtSaveDataInfo  info,
u32  directories,
u32  files,
u64  sizeLimit,
u32  smdhSize,
u8 smdh 
)

Creates ext save data.

Parameters
infoInfo of the save data.
directoriesNumber of directories.
filesNumber of files.
sizeLimitSize limit of the save data.
smdhSizeSize of the save data's SMDH data.
smdhSMDH data.

◆ FSUSER_CreateFile()

Result FSUSER_CreateFile ( FS_Archive  archive,
FS_Path  path,
u32  attributes,
u64  fileSize 
)

Creates a file.

Parameters
archiveArchive to create the file in.
pathPath of the file.
attributesAttributes of the file.
fileSizeSize of the file.

◆ FSUSER_CreateSystemSaveData()

Result FSUSER_CreateSystemSaveData ( FS_SystemSaveDataInfo  info,
u32  totalSize,
u32  blockSize,
u32  directories,
u32  files,
u32  directoryBuckets,
u32  fileBuckets,
bool  duplicateData 
)

Creates system save data.

Parameters
infoInfo of the save data.
totalSizeTotal size of the save data.
blockSizeBlock size of the save data. (usually 0x1000)
directoriesNumber of directories.
filesNumber of files.
directoryBucketsDirectory hash tree bucket count.
fileBucketsFile hash tree bucket count.
duplicateDataWhether to store an internal duplicate of the data.

◆ FSUSER_DeleteDirectory()

Result FSUSER_DeleteDirectory ( FS_Archive  archive,
FS_Path  path 
)

Deletes a directory, failing if it is not empty.

Parameters
archiveArchive containing the directory.
pathPath of the directory.

◆ FSUSER_DeleteDirectoryRecursively()

Result FSUSER_DeleteDirectoryRecursively ( FS_Archive  archive,
FS_Path  path 
)

Deletes a directory, also deleting its contents.

Parameters
archiveArchive containing the directory.
pathPath of the directory.

◆ FSUSER_DeleteExtSaveData()

Result FSUSER_DeleteExtSaveData ( FS_ExtSaveDataInfo  info)

Deletes ext save data.

Parameters
infoInfo of the save data.

◆ FSUSER_DeleteFile()

Result FSUSER_DeleteFile ( FS_Archive  archive,
FS_Path  path 
)

Deletes a file.

Parameters
archiveArchive containing the file.
pathPath of the file.

◆ FSUSER_DeleteSystemSaveData()

Result FSUSER_DeleteSystemSaveData ( FS_SystemSaveDataInfo  info)

Deletes system save data.

Parameters
infoInfo of the save data.

◆ FSUSER_EnumerateExtSaveData()

Result FSUSER_EnumerateExtSaveData ( u32 idsWritten,
u32  idsSize,
FS_MediaType  mediaType,
u32  idSize,
bool  shared,
u8 ids 
)

Enumerates ext save data.

Parameters
idsWrittenPointer to output the number of IDs written to.
idsSizeSize of the IDs buffer.
mediaTypeMedia type to enumerate over.
idSizeSize of each ID element.
sharedWhether to enumerate shared ext save data.
idsPointer to output IDs to.

◆ FSUSER_EnumerateSystemSaveData()

Result FSUSER_EnumerateSystemSaveData ( u32 idsWritten,
u32  idsSize,
u32 ids 
)

Enumerates system save data.

Parameters
idsWrittenPointer to output the number of IDs written to.
idsSizeSize of the IDs buffer.
idsPointer to output IDs to.

◆ FSUSER_ExportIntegrityVerificationSeed()

Result FSUSER_ExportIntegrityVerificationSeed ( FS_IntegrityVerificationSeed seed)

Exports the integrity verification seed.

Parameters
seedPointer to output the seed to.

◆ FSUSER_FormatSaveData()

Result FSUSER_FormatSaveData ( FS_ArchiveID  archiveId,
FS_Path  path,
u32  blocks,
u32  directories,
u32  files,
u32  directoryBuckets,
u32  fileBuckets,
bool  duplicateData 
)

Formats save data.

Parameters
archiveIdID of the save data archive.
pathPath of the save data.
blocksSize of the save data in blocks. (512 bytes)
directoriesNumber of directories.
filesNumber of files.
directoryBucketsDirectory hash tree bucket count.
fileBucketsFile hash tree bucket count.
duplicateDataWhether to store an internal duplicate of the data.

◆ FSUSER_GetArchivePriority()

Result FSUSER_GetArchivePriority ( u32 priority,
FS_Archive  archive 
)

Gets an archive's priority.

Parameters
priorityPointer to output the priority to.
archiveArchive to use.

◆ FSUSER_GetArchiveResource()

Result FSUSER_GetArchiveResource ( FS_ArchiveResource archiveResource,
FS_SystemMediaType  mediaType 
)

Gets an archive's resource information.

Parameters
archiveResourcePointer to output the archive resource information to.
mediaTypeSystem media type to check.

◆ FSUSER_GetCardType()

Result FSUSER_GetCardType ( FS_CardType type)

Gets the inserted card type.

Parameters
typePointer to output the card type to.

◆ FSUSER_GetExtDataBlockSize()

Result FSUSER_GetExtDataBlockSize ( u64 totalBlocks,
u64 freeBlocks,
u32 blockSize,
FS_ExtSaveDataInfo  info 
)

Gets an ext data archive's block information.

Parameters
totalBlocksPointer to output the total blocks to.
freeBlocksPointer to output the free blocks to.
blockSizePointer to output the block size to.
infoInfo of the save data.

◆ FSUSER_GetFormatInfo()

Result FSUSER_GetFormatInfo ( u32 totalSize,
u32 directories,
u32 files,
bool *  duplicateData,
FS_ArchiveID  archiveId,
FS_Path  path 
)

Retrieves archive format info.

Parameters
totalSizePointer to output the total size to.
directoriesPointer to output the number of directories to.
filesPointer to output the number of files to.
duplicateDataPointer to output whether to duplicate data to.
archiveIdID of the archive.
pathPath of the archive.

◆ FSUSER_GetFreeBytes()

Result FSUSER_GetFreeBytes ( u64 freeBytes,
FS_Archive  archive 
)

Gets the number of free bytes within an archive.

Parameters
freeBytesPointer to output the free bytes to.
archiveArchive to check.

◆ FSUSER_GetLegacyBannerData()

Result FSUSER_GetLegacyBannerData ( FS_MediaType  mediaType,
u64  programId,
void *  banner 
)

Gets the legacy banner data of a program.

Parameters
mediaTypeMedia type of the program.
programIdID of the program.
bannerPointer to output the legacy banner data to. (size = 0x23C0)

◆ FSUSER_GetLegacyRomHeader()

Result FSUSER_GetLegacyRomHeader ( FS_MediaType  mediaType,
u64  programId,
void *  header 
)

Gets the legacy ROM header of a program.

Parameters
mediaTypeMedia type of the program.
programIdID of the program.
headerPointer to output the legacy ROM header to. (size = 0x3B4)

◆ FSUSER_GetLegacyRomHeader2()

Result FSUSER_GetLegacyRomHeader2 ( u32  headerSize,
FS_MediaType  mediaType,
u64  programId,
void *  header 
)

Gets the legacy ROM header of a program.

Parameters
headerSizeSize of the ROM header.
mediaTypeMedia type of the program.
programIdID of the program.
headerPointer to output the legacy ROM header to.

◆ FSUSER_GetLegacySubBannerData()

Result FSUSER_GetLegacySubBannerData ( u32  bannerSize,
FS_MediaType  mediaType,
u64  programId,
void *  banner 
)

Gets the legacy sub banner data of a program.

Parameters
bannerSizeSize of the banner.
mediaTypeMedia type of the program.
programIdID of the program.
headerPointer to output the legacy sub banner data to.

◆ FSUSER_GetMediaType()

Result FSUSER_GetMediaType ( FS_MediaType mediaType)

Gets the media type of the current application.

Parameters
mediaTypePointer to output the media type to.

◆ FSUSER_GetNandArchiveResource()

Result FSUSER_GetNandArchiveResource ( FS_ArchiveResource archiveResource)

Gets the NAND archive resource information.

Parameters
archiveResourcePointer to output the archive resource information to.

◆ FSUSER_GetNandCid()

Result FSUSER_GetNandCid ( u8 out,
u32  length 
)

Gets the NAND CID.

Parameters
outPointer to output the CID to.
lengthLength of the CID buffer. (should be 0x10)

◆ FSUSER_GetNandLog()

Result FSUSER_GetNandLog ( u8 out,
u32  length 
)

Gets the NAND log.

Parameters
outPointer to output the log to.
lengthLength of the log buffer.

◆ FSUSER_GetNandSpeedInfo()

Result FSUSER_GetNandSpeedInfo ( FS_SdMmcSpeedInfo speedInfo)

Gets the NAND speed info.

Parameters
speedInfoPointer to output the speed info to.

◆ FSUSER_GetPriority()

Result FSUSER_GetPriority ( u32 priority)

Gets the file system priority.

Parameters
priorityPointer to output the priority to.

◆ FSUSER_GetProductInfo()

Result FSUSER_GetProductInfo ( FS_ProductInfo info,
u32  processId 
)

Gets a process's product info.

Parameters
infoPointer to output the product info to.
processIdID of the process.

◆ FSUSER_GetProgramLaunchInfo()

Result FSUSER_GetProgramLaunchInfo ( FS_ProgramInfo info,
u32  processId 
)

Gets a process's program launch info.

Parameters
infoPointer to output the program launch info to.
processIdID of the process.

◆ FSUSER_GetSaveDataSecureValue()

Result FSUSER_GetSaveDataSecureValue ( bool *  exists,
u64 value,
FS_SecureValueSlot  slot,
u32  titleUniqueId,
u8  titleVariation 
)

Gets the save data secure value.

Parameters
existsPointer to output whether the secure value exists to.
valuePointer to output the secure value to.
slotSlot of the secure value.
titleUniqueIdUnique ID of the title. (default = 0)
titleVariationVariation of the title. (default = 0)

◆ FSUSER_GetSdmcArchiveResource()

Result FSUSER_GetSdmcArchiveResource ( FS_ArchiveResource archiveResource)

Gets the SDMC archive resource information.

Parameters
archiveResourcePointer to output the archive resource information to.

◆ FSUSER_GetSdmcCid()

Result FSUSER_GetSdmcCid ( u8 out,
u32  length 
)

Gets the SDMC CID.

Parameters
outPointer to output the CID to.
lengthLength of the CID buffer. (should be 0x10)

◆ FSUSER_GetSdmcCtrRootPath()

Result FSUSER_GetSdmcCtrRootPath ( u8 out,
u32  length 
)

Gets the CTR SDMC root path.

Parameters
outPointer to output the root path to.
lengthLength of the output buffer.

◆ FSUSER_GetSdmcFatfsError()

Result FSUSER_GetSdmcFatfsError ( u32 error)

Gets the last SDMC fatfs error.

Parameters
errorPointer to output the error to.

◆ FSUSER_GetSdmcLog()

Result FSUSER_GetSdmcLog ( u8 out,
u32  length 
)

Gets the SDMC log.

Parameters
outPointer to output the log to.
lengthLength of the log buffer.

◆ FSUSER_GetSdmcSpeedInfo()

Result FSUSER_GetSdmcSpeedInfo ( FS_SdMmcSpeedInfo speedInfo)

Gets the SDMC speed info.

Parameters
speedInfoPointer to output the speed info to.

◆ FSUSER_GetSpecialContentIndex()

Result FSUSER_GetSpecialContentIndex ( u16 index,
FS_MediaType  mediaType,
u64  programId,
FS_SpecialContentType  type 
)

Gets a special content's index.

Parameters
indexPointer to output the index to.
mediaTypeMedia type of the special content.
programIdProgram ID owning the special content.
typeType of special content.

◆ FSUSER_GetSpecialFileSize()

Result FSUSER_GetSpecialFileSize ( u64 fileSize)

Gets the size of a special file.

Parameters
fileSizePointer to output the size to.

◆ FSUSER_ImportIntegrityVerificationSeed()

Result FSUSER_ImportIntegrityVerificationSeed ( FS_IntegrityVerificationSeed seed)

Imports an integrity verification seed.

Parameters
seedSeed to import.

◆ FSUSER_Initialize()

Result FSUSER_Initialize ( Handle  session)

Initializes a FSUSER session.

Parameters
sessionThe handle of the FSUSER session to initialize.

◆ FSUSER_InitializeWithSdkVersion()

Result FSUSER_InitializeWithSdkVersion ( Handle  session,
u32  version 
)

Initializes a FSUSER session with an SDK version.

Parameters
sessionThe handle of the FSUSER session to initialize.
versionSDK version to initialize with.

◆ FSUSER_IsSdmcDetected()

Result FSUSER_IsSdmcDetected ( bool *  detected)

Gets whether an SD card is detected.

Parameters
detectedPointer to output the detection status to.

◆ FSUSER_IsSdmcWritable()

Result FSUSER_IsSdmcWritable ( bool *  writable)

Gets whether the SD card is writable.

Parameters
writablePointer to output the writable status to.

◆ FSUSER_OpenArchive()

Result FSUSER_OpenArchive ( FS_Archive archive,
FS_ArchiveID  id,
FS_Path  path 
)

Opens an archive.

Parameters
archivePointer to output the opened archive to.
idID of the archive.
pathPath of the archive.

◆ FSUSER_OpenDirectory()

Result FSUSER_OpenDirectory ( Handle out,
FS_Archive  archive,
FS_Path  path 
)

Opens a directory.

Parameters
outPointer to output the directory handle to.
archiveArchive containing the directory.
pathPath of the directory.

◆ FSUSER_OpenFile()

Result FSUSER_OpenFile ( Handle out,
FS_Archive  archive,
FS_Path  path,
u32  openFlags,
u32  attributes 
)

Opens a file.

Parameters
outPointer to output the file handle to.
archiveArchive containing the file.
pathPath of the file.
openFlagsFlags to open the file with.
attributesAttributes of the file.

◆ FSUSER_OpenFileDirectly()

Result FSUSER_OpenFileDirectly ( Handle out,
FS_ArchiveID  archiveId,
FS_Path  archivePath,
FS_Path  filePath,
u32  openFlags,
u32  attributes 
)

Opens a file directly, bypassing the requirement of an opened archive handle.

Parameters
outPointer to output the file handle to.
archiveIdID of the archive containing the file.
archivePathPath of the archive containing the file.
filePathPath of the file.
openFlagsFlags to open the file with.
attributesAttributes of the file.

◆ FSUSER_QueryTotalQuotaSize()

Result FSUSER_QueryTotalQuotaSize ( u64 quotaSize,
u32  directories,
u32  files,
u32  fileSizeCount,
u64 fileSizes 
)

Queries the total quota size of a save data archive.

Parameters
quotaSizePointer to output the quota size to.
directoriesNumber of directories.
filesNumber of files.
fileSizeCountNumber of file sizes to provide.
fileSizesFile sizes to provide.

◆ FSUSER_ReadExtSaveDataIcon()

Result FSUSER_ReadExtSaveDataIcon ( u32 bytesRead,
FS_ExtSaveDataInfo  info,
u32  smdhSize,
u8 smdh 
)

Reads the SMDH icon of ext save data.

Parameters
bytesReadPointer to output the number of bytes read to.
infoInfo of the save data.
smdhSizeSize of the save data SMDH.
smdhPointer to output SMDH data to.

◆ FSUSER_ReadSpecialFile()

Result FSUSER_ReadSpecialFile ( u32 bytesRead,
u64  fileOffset,
u32  size,
void *  data 
)

Reads from a special file.

Parameters
bytesReadPointer to output the number of bytes read to.
fileOffsetOffset of the file.
sizeSize of the buffer.
dataBuffer to read to.

◆ FSUSER_RenameDirectory()

Result FSUSER_RenameDirectory ( FS_Archive  srcArchive,
FS_Path  srcPath,
FS_Archive  dstArchive,
FS_Path  dstPath 
)

Renames a directory.

Parameters
srcArchiveArchive containing the source directory.
srcPathPath of the source directory.
dstArchiveArchive containing the destination directory.
dstPathPath of the destination directory.

◆ FSUSER_RenameFile()

Result FSUSER_RenameFile ( FS_Archive  srcArchive,
FS_Path  srcPath,
FS_Archive  dstArchive,
FS_Path  dstPath 
)

Renames a file.

Parameters
srcArchiveArchive containing the source file.
srcPathPath of the source file.
dstArchiveArchive containing the destination file.
dstPathPath of the destination file.

◆ FSUSER_SetArchivePriority()

Result FSUSER_SetArchivePriority ( FS_Archive  archive,
u32  priority 
)

Sets an archive's priority.

Parameters
archiveArchive to use.
priorityPriority to set.

◆ FSUSER_SetCardSpiBaudRate()

Result FSUSER_SetCardSpiBaudRate ( FS_CardSpiBaudRate  baudRate)

Sets the CARDSPI baud rate.

Parameters
baudRateBaud rate to set.

◆ FSUSER_SetCardSpiBusMode()

Result FSUSER_SetCardSpiBusMode ( FS_CardSpiBusMode  busMode)

Sets the CARDSPI bus mode.

Parameters
busModeBus mode to set.

◆ FSUSER_SetCtrCardLatencyParameter()

Result FSUSER_SetCtrCardLatencyParameter ( u64  latency,
bool  emulateEndurance 
)

Configures CTRCARD latency emulation.

Parameters
latencyLatency to apply, in milliseconds.
emulateEnduranceWhether to emulate card endurance.

◆ FSUSER_SetPriority()

Result FSUSER_SetPriority ( u32  priority)

Sets the file system priority.

Parameters
priorityPriority to set.

◆ FSUSER_SetSaveDataSecureValue()

Result FSUSER_SetSaveDataSecureValue ( u64  value,
FS_SecureValueSlot  slot,
u32  titleUniqueId,
u8  titleVariation 
)

Sets the save data secure value.

Parameters
valueSecure value to set.
slotSlot of the secure value.
titleUniqueIdUnique ID of the title. (default = 0)
titleVariationVariation of the title. (default = 0)

◆ FSUSER_StartDeviceMoveAsDestination()

Result FSUSER_StartDeviceMoveAsDestination ( FS_DeviceMoveContext  context,
bool  clear 
)

Initiates a device move as the destination device.

Parameters
contextContext to use.
clearWhether to clear the device's data first.

◆ FSUSER_StartDeviceMoveAsSource()

Result FSUSER_StartDeviceMoveAsSource ( FS_DeviceMoveContext context)

Initiates a device move as the source device.

Parameters
contextPointer to output the context to.

◆ FSUSER_SwitchCleanupInvalidSaveData()

Result FSUSER_SwitchCleanupInvalidSaveData ( bool  enable)

Toggles cleaning up invalid save data.

Parameters
enableWhether to enable cleaning up invalid save data.

◆ FSUSER_UpdateSha256Context()

Result FSUSER_UpdateSha256Context ( const void *  data,
u32  inputSize,
u8 hash 
)

Hashes the given data and outputs a SHA256 hash.

Parameters
dataPointer to the data to be hashed.
inputSizeThe size of the data.
hashHash output pointer.

◆ fsUseSession()

void fsUseSession ( Handle  session)

Sets the FSUSER session to use in the current thread.

Parameters
sessionThe handle of the FSUSER session to use.