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...
Handle * | fsGetSessionHandle (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

enum 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

enum 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

enum 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

enum FS_CardSpiBusMode

Card SPI bus mode.

Enumerator
BUSMODE_1BIT | 1-bit.
BUSMODE_4BIT | 4-bit.

## FS_CardType

enum FS_CardType

Enumerator
CARD_CTR | CTR card.
CARD_TWL | TWL card.

## FS_MediaType

enum FS_MediaType

Media types.

Enumerator
MEDIATYPE_NAND | NAND.
MEDIATYPE_SD | SD card.
MEDIATYPE_GAME_CARD | Game card.

## FS_PathType

enum 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

enum 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

enum FS_SecureValueSlot

Secure value slot.

Enumerator
SECUREVALUE_SLOT_SD | SD application.

## FS_SpecialContentType

enum FS_SpecialContentType

Card SPI bus mode.

Enumerator
SPECIALCONTENT_UPDATE | Update.
SPECIALCONTENT_MANUAL | Manual.
SPECIALCONTENT_DLP_CHILD | DLP child.

## FS_SystemMediaType

enum 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

  handle | Handle 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

  handle | Handle of the directory.
  action | Action to perform.
  input | Buffer to read input from.
  inputSize | Size of the input.
  output | Buffer to write output to.
  outputSize | Size of the output.

## FSDIR_GetPriority()

Result FSDIR_GetPriority | ( | Handle | handle,
|  | u32 * | priority
| ) |  |

Gets a directory's priority.

Parameters

  handle | Handle of the directory.
  priority | Pointer 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

  handle | Handle of the directory.
  entriesRead | Pointer to output the number of entries read to.
  entryCount | Number of entries to read.
  entryOut | Pointer to output directory entries to.

## FSDIR_SetPriority()

Result FSDIR_SetPriority | ( | Handle | handle,
|  | u32 | priority
| ) |  |

Sets a directory's priority.

Parameters

  handle | Handle of the directory.
  priority | Priority 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

  archive | Archive to exempt.

## FSFILE_Close()

Result FSFILE_Close | ( | Handle | handle | ) |

Closes a file.

Parameters

  handle | Handle 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

  handle | Handle of the file.
  action | Action to perform.
  input | Buffer to read input from.
  inputSize | Size of the input.
  output | Buffer to write output to.
  outputSize | Size of the output.

## FSFILE_Flush()

Result FSFILE_Flush | ( | Handle | handle | ) |

Flushes a file's contents.

Parameters

  handle | Handle of the file.

## FSFILE_GetAttributes()

Result FSFILE_GetAttributes | ( | Handle | handle,
|  | u32 * | attributes
| ) |  |

Gets the attributes of a file.

Parameters

  handle | Handle of the file.
  attributes | Pointer to output the attributes to.

## FSFILE_GetPriority()

Result FSFILE_GetPriority | ( | Handle | handle,
|  | u32 * | priority
| ) |  |

Gets a file's priority.

Parameters

  handle | Handle of the file.
  priority | Pointer to output the priority to.

## FSFILE_GetSize()

Result FSFILE_GetSize | ( | Handle | handle,
|  | u64 * | size
| ) |  |

Gets the size of a file.

Parameters

  handle | Handle of the file.
  size | Pointer to output the size to.

## FSFILE_OpenLinkFile()

Result FSFILE_OpenLinkFile | ( | Handle | handle,
|  | Handle * | linkFile
| ) |  |

Opens a duplicate handle to a file.

Parameters

  handle | Handle of the file.
  linkFile | Pointer 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

  handle | Handle of the file.
  subFile | Pointer to output the sub-file to.
  offset | Offset of the sub-section.
  size | Size of the sub-section.

## FSFILE_Read()

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

Reads from a file.

Parameters

  handle | Handle of the file.
  bytesRead | Pointer to output the number of bytes read to.
  offset | Offset to read from.
  buffer | Buffer to read to.
  size | Size of the buffer.

## FSFILE_SetAttributes()

Result FSFILE_SetAttributes | ( | Handle | handle,
|  | u32 | attributes
| ) |  |

Sets the attributes of a file.

Parameters

  handle | Handle of the file.
  attributes | Attributes to set.

## FSFILE_SetPriority()

Result FSFILE_SetPriority | ( | Handle | handle,
|  | u32 | priority
| ) |  |

Sets a file's priority.

Parameters

  handle | Handle of the file.
  priority | Priority to set.

## FSFILE_SetSize()

Result FSFILE_SetSize | ( | Handle | handle,
|  | u64 | size
| ) |  |

Sets the size of a file.

Parameters

  handle | Handle of the file.
  size | Size 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

  handle | Handle of the file.
  bytesWritten | Pointer to output the number of bytes written to.
  offset | Offset to write to.
  buffer | Buffer to write from.
  size | Size of the buffer.
  flags | Flags 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

  type | Type of path.
  path | Path 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

  archive | Archive to remove from the exemption list.

## FSUSER_AbnegateAccessRight()

Result FSUSER_AbnegateAccessRight | ( | u32 | accessRight | ) |

Abnegates an access right.

Parameters

  accessRight | Access right to abnegate.

## FSUSER_CardNorDirectCommand()

Result FSUSER_CardNorDirectCommand | ( | u8 | commandId | ) |

Executes a CARDNOR direct command.

Parameters

  commandId | ID of the command.

## FSUSER_CardNorDirectCommandWithAddress()

Result FSUSER_CardNorDirectCommandWithAddress | ( | u8 | commandId,
|  | u32 | address
| ) |  |

Executes a CARDNOR direct command with an address.

Parameters

  commandId | ID of the command.
  address | Address to provide.

## FSUSER_CardNorDirectCpuWriteWithoutVerify()

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

Executes a CARDNOR direct CPU write without verify.

Parameters

  address | Address to provide.
  size | Size of the input buffer.
  output | Input buffer.

## FSUSER_CardNorDirectRead()

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

Executes a CARDNOR direct read.

Parameters

  commandId | ID of the command.
  size | Size of the output buffer.
  output | Output buffer.

## FSUSER_CardNorDirectRead_4xIO()

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

Executes a CARDNOR 4xIO direct read.

Parameters

  commandId | ID of the command.
  address | Address to provide.
  size | Size of the output buffer.
  output | Output buffer.

## FSUSER_CardNorDirectReadWithAddress()

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

Executes a CARDNOR direct read with an address.

Parameters

  commandId | ID of the command.
  address | Address to provide.
  size | Size of the output buffer.
  output | Output buffer.

## FSUSER_CardNorDirectSectorEraseWithoutVerify()

Result FSUSER_CardNorDirectSectorEraseWithoutVerify | ( | u32 | address | ) |

Executes a CARDNOR direct sector erase without verify.

Parameters

  address | Address to provide.

## FSUSER_CardNorDirectWrite()

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

Executes a CARDNOR direct write.

Parameters

  commandId | ID of the command.
  size | Size of the input buffer.
  output | Input buffer.

## FSUSER_CardNorDirectWriteWithAddress()

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

Executes a CARDNOR direct write with an address.

Parameters

  commandId | ID of the command.
  address | Address to provide.
  size | Size of the input buffer.
  input | Input buffer.

## FSUSER_CardSlotGetCardIFPowerStatus()

Result FSUSER_CardSlotGetCardIFPowerStatus | ( | bool * | status | ) |

Gets the card's power status.

Parameters

  status | Pointer to output the power status to.

## FSUSER_CardSlotIsInserted()

Result FSUSER_CardSlotIsInserted | ( | bool * | inserted | ) |

Gets whether a card is inserted.

Parameters

  inserted | Pointer to output the insertion status to.

## FSUSER_CardSlotPowerOff()

Result FSUSER_CardSlotPowerOff | ( | bool * | status | ) |

Powers off the card slot.

Parameters

  status | Pointer to output the power status to.

## FSUSER_CardSlotPowerOn()

Result FSUSER_CardSlotPowerOn | ( | bool * | status | ) |

Powers on the card slot.

Parameters

  status | Pointer 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

  access | Pointer to output the access status to.
  mediaType | Media type of the save data.
  saveId | ID of the save data.
  processId | ID of the process to check.

## FSUSER_CloseArchive()

Result FSUSER_CloseArchive | ( | FS_Archive | archive | ) |

Closes an archive.

Parameters

  archive | Archive 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

  action | Action to perform.
  input | Buffer to read input from.
  inputSize | Size of the input.
  output | Buffer to write output to.
  outputSize | Size 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

  archive | Archive to control.
  action | Action to perform.
  input | Buffer to read input from.
  inputSize | Size of the input.
  output | Buffer to write output to.
  outputSize | Size 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

  action | Action to perform.
  input | Buffer to read input from.
  inputSize | Size of the input.
  output | Buffer to write output to.
  outputSize | Size of the output.

## FSUSER_CreateDirectory()

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

Creates a directory.

Parameters

  archive | Archive to create the directory in.
  path | Path of the directory.
  attributes | Attributes 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

  info | Info of the save data.
  directories | Number of directories.
  files | Number of files.
  sizeLimit | Size limit of the save data.
  smdhSize | Size of the save data's SMDH data.
  smdh | SMDH data.

## FSUSER_CreateFile()

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

Creates a file.

Parameters

  archive | Archive to create the file in.
  path | Path of the file.
  attributes | Attributes of the file.
  fileSize | Size 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

  info | Info of the save data.
  totalSize | Total size of the save data.
  blockSize | Block size of the save data. (usually 0x1000)
  directories | Number of directories.
  files | Number of files.
  directoryBuckets | Directory hash tree bucket count.
  fileBuckets | File hash tree bucket count.
  duplicateData | Whether 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

  archive | Archive containing the directory.
  path | Path of the directory.

## FSUSER_DeleteDirectoryRecursively()

Result FSUSER_DeleteDirectoryRecursively | ( | FS_Archive | archive,
|  | FS_Path | path
| ) |  |

Deletes a directory, also deleting its contents.

Parameters

  archive | Archive containing the directory.
  path | Path of the directory.

## FSUSER_DeleteExtSaveData()

Result FSUSER_DeleteExtSaveData | ( | FS_ExtSaveDataInfo | info | ) |

Deletes ext save data.

Parameters

  info | Info of the save data.

## FSUSER_DeleteFile()

Result FSUSER_DeleteFile | ( | FS_Archive | archive,
|  | FS_Path | path
| ) |  |

Deletes a file.

Parameters

  archive | Archive containing the file.
  path | Path of the file.

## FSUSER_DeleteSystemSaveData()

Result FSUSER_DeleteSystemSaveData | ( | FS_SystemSaveDataInfo | info | ) |

Deletes system save data.

Parameters

  info | Info 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

  idsWritten | Pointer to output the number of IDs written to.
  idsSize | Size of the IDs buffer.
  mediaType | Media type to enumerate over.
  idSize | Size of each ID element.
  shared | Whether to enumerate shared ext save data.
  ids | Pointer to output IDs to.

## FSUSER_EnumerateSystemSaveData()

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

Enumerates system save data.

Parameters

  idsWritten | Pointer to output the number of IDs written to.
  idsSize | Size of the IDs buffer.
  ids | Pointer to output IDs to.

## FSUSER_ExportIntegrityVerificationSeed()

Result FSUSER_ExportIntegrityVerificationSeed | ( | FS_IntegrityVerificationSeed * | seed | ) |

Exports the integrity verification seed.

Parameters

  seed | Pointer 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

  archiveId | ID of the save data archive.
  path | Path of the save data.
  blocks | Size of the save data in blocks. (512 bytes)
  directories | Number of directories.
  files | Number of files.
  directoryBuckets | Directory hash tree bucket count.
  fileBuckets | File hash tree bucket count.
  duplicateData | Whether to store an internal duplicate of the data.

## FSUSER_GetArchivePriority()

Result FSUSER_GetArchivePriority | ( | u32 * | priority,
|  | FS_Archive | archive
| ) |  |

Gets an archive's priority.

Parameters

  priority | Pointer to output the priority to.
  archive | Archive to use.

## FSUSER_GetArchiveResource()

Result FSUSER_GetArchiveResource | ( | FS_ArchiveResource * | archiveResource,
|  | FS_SystemMediaType | mediaType
| ) |  |

Gets an archive's resource information.

Parameters

  archiveResource | Pointer to output the archive resource information to.
  mediaType | System media type to check.

## FSUSER_GetCardType()

Result FSUSER_GetCardType | ( | FS_CardType * | type | ) |

Gets the inserted card type.

Parameters

  type | Pointer 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

  totalBlocks | Pointer to output the total blocks to.
  freeBlocks | Pointer to output the free blocks to.
  blockSize | Pointer to output the block size to.
  info | Info 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

  totalSize | Pointer to output the total size to.
  directories | Pointer to output the number of directories to.
  files | Pointer to output the number of files to.
  duplicateData | Pointer to output whether to duplicate data to.
  archiveId | ID of the archive.
  path | Path of the archive.

## FSUSER_GetFreeBytes()

Result FSUSER_GetFreeBytes | ( | u64 * | freeBytes,
|  | FS_Archive | archive
| ) |  |

Gets the number of free bytes within an archive.

Parameters

  freeBytes | Pointer to output the free bytes to.
  archive | Archive to check.

## FSUSER_GetLegacyBannerData()

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

Gets the legacy banner data of a program.

Parameters

  mediaType | Media type of the program.
  programId | ID of the program.
  banner | Pointer 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

  mediaType | Media type of the program.
  programId | ID of the program.
  header | Pointer 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

  headerSize | Size of the ROM header.
  mediaType | Media type of the program.
  programId | ID of the program.
  header | Pointer 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

  bannerSize | Size of the banner.
  mediaType | Media type of the program.
  programId | ID of the program.
  header | Pointer 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

  mediaType | Pointer to output the media type to.

## FSUSER_GetNandArchiveResource()

Result FSUSER_GetNandArchiveResource | ( | FS_ArchiveResource * | archiveResource | ) |

Gets the NAND archive resource information.

Parameters

  archiveResource | Pointer to output the archive resource information to.

## FSUSER_GetNandCid()

Result FSUSER_GetNandCid | ( | u8 * | out,
|  | u32 | length
| ) |  |

Gets the NAND CID.

Parameters

  out | Pointer to output the CID to.
  length | Length of the CID buffer. (should be 0x10)

## FSUSER_GetNandLog()

Result FSUSER_GetNandLog | ( | u8 * | out,
|  | u32 | length
| ) |  |

Gets the NAND log.

Parameters

  out | Pointer to output the log to.
  length | Length of the log buffer.

## FSUSER_GetNandSpeedInfo()

Result FSUSER_GetNandSpeedInfo | ( | FS_SdMmcSpeedInfo * | speedInfo | ) |

Gets the NAND speed info.

Parameters

  speedInfo | Pointer to output the speed info to.

## FSUSER_GetPriority()

Result FSUSER_GetPriority | ( | u32 * | priority | ) |

Gets the file system priority.

Parameters

  priority | Pointer to output the priority to.

## FSUSER_GetProductInfo()

Result FSUSER_GetProductInfo | ( | FS_ProductInfo * | info,
|  | u32 | processId
| ) |  |

Gets a process's product info.

Parameters

  info | Pointer to output the product info to.
  processId | ID of the process.

## FSUSER_GetProgramLaunchInfo()

Result FSUSER_GetProgramLaunchInfo | ( | FS_ProgramInfo * | info,
|  | u32 | processId
| ) |  |

Gets a process's program launch info.

Parameters

  info | Pointer to output the program launch info to.
  processId | ID 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

  exists | Pointer to output whether the secure value exists to.
  value | Pointer to output the secure value to.
  slot | Slot of the secure value.
  titleUniqueId | Unique ID of the title. (default = 0)
  titleVariation | Variation of the title. (default = 0)

## FSUSER_GetSdmcArchiveResource()

Result FSUSER_GetSdmcArchiveResource | ( | FS_ArchiveResource * | archiveResource | ) |

Gets the SDMC archive resource information.

Parameters

  archiveResource | Pointer to output the archive resource information to.

## FSUSER_GetSdmcCid()

Result FSUSER_GetSdmcCid | ( | u8 * | out,
|  | u32 | length
| ) |  |

Gets the SDMC CID.

Parameters

  out | Pointer to output the CID to.
  length | Length of the CID buffer. (should be 0x10)

## FSUSER_GetSdmcCtrRootPath()

Result FSUSER_GetSdmcCtrRootPath | ( | u8 * | out,
|  | u32 | length
| ) |  |

Gets the CTR SDMC root path.

Parameters

  out | Pointer to output the root path to.
  length | Length of the output buffer.

## FSUSER_GetSdmcFatfsError()

Result FSUSER_GetSdmcFatfsError | ( | u32 * | error | ) |

Gets the last SDMC fatfs error.

Parameters

  error | Pointer to output the error to.

## FSUSER_GetSdmcLog()

Result FSUSER_GetSdmcLog | ( | u8 * | out,
|  | u32 | length
| ) |  |

Gets the SDMC log.

Parameters

  out | Pointer to output the log to.
  length | Length of the log buffer.

## FSUSER_GetSdmcSpeedInfo()

Result FSUSER_GetSdmcSpeedInfo | ( | FS_SdMmcSpeedInfo * | speedInfo | ) |

Gets the SDMC speed info.

Parameters

  speedInfo | Pointer 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

  index | Pointer to output the index to.
  mediaType | Media type of the special content.
  programId | Program ID owning the special content.
  type | Type of special content.

## FSUSER_GetSpecialFileSize()

Result FSUSER_GetSpecialFileSize | ( | u64 * | fileSize | ) |

Gets the size of a special file.

Parameters

  fileSize | Pointer to output the size to.

## FSUSER_ImportIntegrityVerificationSeed()

Result FSUSER_ImportIntegrityVerificationSeed | ( | FS_IntegrityVerificationSeed * | seed | ) |

Imports an integrity verification seed.

Parameters

  seed | Seed to import.

## FSUSER_Initialize()

Result FSUSER_Initialize | ( | Handle | session | ) |

Initializes a FSUSER session.

Parameters

  session | The 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

  session | The handle of the FSUSER session to initialize.
  version | SDK version to initialize with.

## FSUSER_IsSdmcDetected()

Result FSUSER_IsSdmcDetected | ( | bool * | detected | ) |

Gets whether an SD card is detected.

Parameters

  detected | Pointer to output the detection status to.

## FSUSER_IsSdmcWritable()

Result FSUSER_IsSdmcWritable | ( | bool * | writable | ) |

Gets whether the SD card is writable.

Parameters

  writable | Pointer to output the writable status to.

## FSUSER_OpenArchive()

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

Opens an archive.

Parameters

  archive | Pointer to output the opened archive to.
  id | ID of the archive.
  path | Path of the archive.

## FSUSER_OpenDirectory()

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

Opens a directory.

Parameters

  out | Pointer to output the directory handle to.
  archive | Archive containing the directory.
  path | Path of the directory.

## FSUSER_OpenFile()

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

Opens a file.

Parameters

  out | Pointer to output the file handle to.
  archive | Archive containing the file.
  path | Path of the file.
  openFlags | Flags to open the file with.
  attributes | Attributes 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

  out | Pointer to output the file handle to.
  archiveId | ID of the archive containing the file.
  archivePath | Path of the archive containing the file.
  filePath | Path of the file.
  openFlags | Flags to open the file with.
  attributes | Attributes 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

  quotaSize | Pointer to output the quota size to.
  directories | Number of directories.
  files | Number of files.
  fileSizeCount | Number of file sizes to provide.
  fileSizes | File 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

  bytesRead | Pointer to output the number of bytes read to.
  info | Info of the save data.
  smdhSize | Size of the save data SMDH.
  smdh | Pointer to output SMDH data to.

## FSUSER_ReadSpecialFile()

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

Reads from a special file.

Parameters

  bytesRead | Pointer to output the number of bytes read to.
  fileOffset | Offset of the file.
  size | Size of the buffer.
  data | Buffer to read to.

## FSUSER_RenameDirectory()

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

Renames a directory.

Parameters

  srcArchive | Archive containing the source directory.
  srcPath | Path of the source directory.
  dstArchive | Archive containing the destination directory.
  dstPath | Path 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

  srcArchive | Archive containing the source file.
  srcPath | Path of the source file.
  dstArchive | Archive containing the destination file.
  dstPath | Path of the destination file.

## FSUSER_SetArchivePriority()

Result FSUSER_SetArchivePriority | ( | FS_Archive | archive,
|  | u32 | priority
| ) |  |

Sets an archive's priority.

Parameters

  archive | Archive to use.
  priority | Priority to set.

## FSUSER_SetCardSpiBaudRate()

Result FSUSER_SetCardSpiBaudRate | ( | FS_CardSpiBaudRate | baudRate | ) |

Sets the CARDSPI baud rate.

Parameters

  baudRate | Baud rate to set.

## FSUSER_SetCardSpiBusMode()

Result FSUSER_SetCardSpiBusMode | ( | FS_CardSpiBusMode | busMode | ) |

Sets the CARDSPI bus mode.

Parameters

  busMode | Bus mode to set.

## FSUSER_SetCtrCardLatencyParameter()

Result FSUSER_SetCtrCardLatencyParameter | ( | u64 | latency,
|  | bool | emulateEndurance
| ) |  |

Configures CTRCARD latency emulation.

Parameters

  latency | Latency to apply, in milliseconds.
  emulateEndurance | Whether to emulate card endurance.

## FSUSER_SetPriority()

Result FSUSER_SetPriority | ( | u32 | priority | ) |

Sets the file system priority.

Parameters

  priority | Priority to set.

## FSUSER_SetSaveDataSecureValue()

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

Sets the save data secure value.

Parameters

  value | Secure value to set.
  slot | Slot of the secure value.
  titleUniqueId | Unique ID of the title. (default = 0)
  titleVariation | Variation of the title. (default = 0)

## FSUSER_StartDeviceMoveAsDestination()

Result FSUSER_StartDeviceMoveAsDestination | ( | FS_DeviceMoveContext | context,
|  | bool | clear
| ) |  |

Initiates a device move as the destination device.

Parameters

  context | Context to use.
  clear | Whether to clear the device's data first.

## FSUSER_StartDeviceMoveAsSource()

Result FSUSER_StartDeviceMoveAsSource | ( | FS_DeviceMoveContext * | context | ) |

Initiates a device move as the source device.

Parameters

  context | Pointer to output the context to.

## FSUSER_SwitchCleanupInvalidSaveData()

Result FSUSER_SwitchCleanupInvalidSaveData | ( | bool | enable | ) |

Toggles cleaning up invalid save data.

Parameters

  enable | Whether 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

  data | Pointer to the data to be hashed.
  inputSize | The size of the data.
  hash | Hash output pointer.

## fsUseSession()

void fsUseSession | ( | Handle | session | ) |

Sets the FSUSER session to use in the current thread.

Parameters

  session | The handle of the FSUSER session to use.