libctru
v2.4.1
|
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. | |
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... | |
Filesystem Services.
anonymous enum |
anonymous enum |
anonymous enum |
enum FS_ArchiveAction |
enum FS_ArchiveID |
Archive IDs.
enum FS_CardSpiBaudRate |
enum FS_CardSpiBusMode |
enum FS_CardType |
enum FS_MediaType |
enum FS_PathType |
enum FS_SecureSaveAction |
enum FS_SecureValueSlot |
enum FS_SystemMediaType |
Result FSDIR_Control | ( | Handle | handle, |
FS_DirectoryAction | action, | ||
void * | input, | ||
u32 | inputSize, | ||
void * | output, | ||
u32 | outputSize | ||
) |
Performs a control operation on a directory.
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. |
Gets a directory's priority.
handle | Handle of the directory. |
priority | Pointer to output the priority to. |
Result FSDIR_Read | ( | Handle | handle, |
u32 * | entriesRead, | ||
u32 | entryCount, | ||
FS_DirectoryEntry * | entries | ||
) |
Reads one or more directory entries.
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. |
Sets a directory's priority.
handle | Handle of the directory. |
priority | Priority to set. |
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.
archive | Archive to exempt. |
Result FSFILE_Control | ( | Handle | handle, |
FS_FileAction | action, | ||
void * | input, | ||
u32 | inputSize, | ||
void * | output, | ||
u32 | outputSize | ||
) |
Performs a control operation on a file.
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. |
Flushes a file's contents.
handle | Handle of the file. |
Gets the attributes of a file.
handle | Handle of the file. |
attributes | Pointer to output the attributes to. |
Gets a file's priority.
handle | Handle of the file. |
priority | Pointer to output the priority to. |
Gets the size of a file.
handle | Handle of the file. |
size | Pointer to output the size to. |
Opens a duplicate handle to a file.
handle | Handle of the file. |
linkFile | Pointer to output the link handle to. |
Opens a handle to a sub-section of a file.
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. |
Reads from a file.
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. |
Sets the attributes of a file.
handle | Handle of the file. |
attributes | Attributes to set. |
Sets a file's priority.
handle | Handle of the file. |
priority | Priority to set. |
Sets the size of a file.
handle | Handle of the file. |
size | Size to set. |
Result FSFILE_Write | ( | Handle | handle, |
u32 * | bytesWritten, | ||
u64 | offset, | ||
const void * | buffer, | ||
u32 | size, | ||
u32 | flags | ||
) |
Writes to a file.
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. |
Handle* fsGetSessionHandle | ( | void | ) |
Gets the current FS session handle.
FS_Path fsMakePath | ( | FS_PathType | type, |
const void * | path | ||
) |
void fsUnexemptFromSession | ( | FS_Archive | archive | ) |
Unexempts an archive from using alternate FS session handles provided with fsUseSession.
archive | Archive to remove from the exemption list. |
Abnegates an access right.
accessRight | Access right to abnegate. |
Executes a CARDNOR direct command.
commandId | ID of the command. |
Executes a CARDNOR direct command with an address.
commandId | ID of the command. |
address | Address to provide. |
Executes a CARDNOR direct CPU write without verify.
address | Address to provide. |
size | Size of the input buffer. |
output | Input buffer. |
Executes a CARDNOR direct read.
commandId | ID of the command. |
size | Size of the output buffer. |
output | Output buffer. |
Executes a CARDNOR 4xIO direct read.
commandId | ID of the command. |
address | Address to provide. |
size | Size of the output buffer. |
output | Output buffer. |
Executes a CARDNOR direct read with an address.
commandId | ID of the command. |
address | Address to provide. |
size | Size of the output buffer. |
output | Output buffer. |
Executes a CARDNOR direct sector erase without verify.
address | Address to provide. |
Executes a CARDNOR direct write.
commandId | ID of the command. |
size | Size of the input buffer. |
output | Input buffer. |
Result FSUSER_CardNorDirectWriteWithAddress | ( | u8 | commandId, |
u32 | address, | ||
u32 | size, | ||
const void * | input | ||
) |
Executes a CARDNOR direct write with an address.
commandId | ID of the command. |
address | Address to provide. |
size | Size of the input buffer. |
input | Input buffer. |
Result FSUSER_CardSlotGetCardIFPowerStatus | ( | bool * | status | ) |
Gets the card's power status.
status | Pointer to output the power status to. |
Result FSUSER_CardSlotIsInserted | ( | bool * | inserted | ) |
Gets whether a card is inserted.
inserted | Pointer to output the insertion status to. |
Result FSUSER_CardSlotPowerOff | ( | bool * | status | ) |
Powers off the card slot.
status | Pointer to output the power status to. |
Result FSUSER_CardSlotPowerOn | ( | bool * | status | ) |
Powers on the card slot.
status | Pointer to output the power status to. |
Result FSUSER_CheckAuthorityToAccessExtSaveData | ( | bool * | access, |
FS_MediaType | mediaType, | ||
u64 | saveId, | ||
u32 | processId | ||
) |
Checks a process's authority to access a save data archive.
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. |
Result FSUSER_CloseArchive | ( | FS_Archive | archive | ) |
Closes an archive.
archive | Archive to close. |
Result FSUSER_Control | ( | FS_Action | action, |
void * | input, | ||
u32 | inputSize, | ||
void * | output, | ||
u32 | outputSize | ||
) |
Performs a control operation on the filesystem.
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. |
Result FSUSER_ControlArchive | ( | FS_Archive | archive, |
FS_ArchiveAction | action, | ||
void * | input, | ||
u32 | inputSize, | ||
void * | output, | ||
u32 | outputSize | ||
) |
Performs a control operation on an archive.
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. |
Result FSUSER_ControlSecureSave | ( | FS_SecureSaveAction | action, |
void * | input, | ||
u32 | inputSize, | ||
void * | output, | ||
u32 | outputSize | ||
) |
Performs a control operation on a secure save.
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. |
Result FSUSER_CreateDirectory | ( | FS_Archive | archive, |
FS_Path | path, | ||
u32 | attributes | ||
) |
Creates a directory.
archive | Archive to create the directory in. |
path | Path of the directory. |
attributes | Attributes of the directory. |
Result FSUSER_CreateExtSaveData | ( | FS_ExtSaveDataInfo | info, |
u32 | directories, | ||
u32 | files, | ||
u64 | sizeLimit, | ||
u32 | smdhSize, | ||
u8 * | smdh | ||
) |
Creates ext save data.
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. |
Result FSUSER_CreateFile | ( | FS_Archive | archive, |
FS_Path | path, | ||
u32 | attributes, | ||
u64 | fileSize | ||
) |
Creates a file.
archive | Archive to create the file in. |
path | Path of the file. |
attributes | Attributes of the file. |
fileSize | Size of the file. |
Result FSUSER_CreateSystemSaveData | ( | FS_SystemSaveDataInfo | info, |
u32 | totalSize, | ||
u32 | blockSize, | ||
u32 | directories, | ||
u32 | files, | ||
u32 | directoryBuckets, | ||
u32 | fileBuckets, | ||
bool | duplicateData | ||
) |
Creates system save data.
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. |
Result FSUSER_DeleteDirectory | ( | FS_Archive | archive, |
FS_Path | path | ||
) |
Deletes a directory, failing if it is not empty.
archive | Archive containing the directory. |
path | Path of the directory. |
Result FSUSER_DeleteDirectoryRecursively | ( | FS_Archive | archive, |
FS_Path | path | ||
) |
Deletes a directory, also deleting its contents.
archive | Archive containing the directory. |
path | Path of the directory. |
Result FSUSER_DeleteExtSaveData | ( | FS_ExtSaveDataInfo | info | ) |
Deletes ext save data.
info | Info of the save data. |
Result FSUSER_DeleteFile | ( | FS_Archive | archive, |
FS_Path | path | ||
) |
Deletes a file.
archive | Archive containing the file. |
path | Path of the file. |
Result FSUSER_DeleteSystemSaveData | ( | FS_SystemSaveDataInfo | info | ) |
Deletes system save data.
info | Info of the save data. |
Result FSUSER_EnumerateExtSaveData | ( | u32 * | idsWritten, |
u32 | idsSize, | ||
FS_MediaType | mediaType, | ||
u32 | idSize, | ||
bool | shared, | ||
u8 * | ids | ||
) |
Enumerates ext save data.
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. |
Enumerates system save data.
idsWritten | Pointer to output the number of IDs written to. |
idsSize | Size of the IDs buffer. |
ids | Pointer to output IDs to. |
Result FSUSER_ExportIntegrityVerificationSeed | ( | FS_IntegrityVerificationSeed * | seed | ) |
Exports the integrity verification seed.
seed | Pointer to output the seed to. |
Result FSUSER_FormatSaveData | ( | FS_ArchiveID | archiveId, |
FS_Path | path, | ||
u32 | blocks, | ||
u32 | directories, | ||
u32 | files, | ||
u32 | directoryBuckets, | ||
u32 | fileBuckets, | ||
bool | duplicateData | ||
) |
Formats save data.
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. |
Result FSUSER_GetArchivePriority | ( | u32 * | priority, |
FS_Archive | archive | ||
) |
Gets an archive's priority.
priority | Pointer to output the priority to. |
archive | Archive to use. |
Result FSUSER_GetArchiveResource | ( | FS_ArchiveResource * | archiveResource, |
FS_SystemMediaType | mediaType | ||
) |
Gets an archive's resource information.
archiveResource | Pointer to output the archive resource information to. |
mediaType | System media type to check. |
Result FSUSER_GetCardType | ( | FS_CardType * | type | ) |
Gets the inserted card type.
type | Pointer to output the card type to. |
Result FSUSER_GetExtDataBlockSize | ( | u64 * | totalBlocks, |
u64 * | freeBlocks, | ||
u32 * | blockSize, | ||
FS_ExtSaveDataInfo | info | ||
) |
Gets an ext data archive's block information.
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. |
Result FSUSER_GetFormatInfo | ( | u32 * | totalSize, |
u32 * | directories, | ||
u32 * | files, | ||
bool * | duplicateData, | ||
FS_ArchiveID | archiveId, | ||
FS_Path | path | ||
) |
Retrieves archive format info.
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. |
Result FSUSER_GetFreeBytes | ( | u64 * | freeBytes, |
FS_Archive | archive | ||
) |
Gets the number of free bytes within an archive.
freeBytes | Pointer to output the free bytes to. |
archive | Archive to check. |
Result FSUSER_GetLegacyBannerData | ( | FS_MediaType | mediaType, |
u64 | programId, | ||
void * | banner | ||
) |
Gets the legacy banner data of a program.
mediaType | Media type of the program. |
programId | ID of the program. |
banner | Pointer to output the legacy banner data to. (size = 0x23C0) |
Result FSUSER_GetLegacyRomHeader | ( | FS_MediaType | mediaType, |
u64 | programId, | ||
void * | header | ||
) |
Gets the legacy ROM header of a program.
mediaType | Media type of the program. |
programId | ID of the program. |
header | Pointer to output the legacy ROM header to. (size = 0x3B4) |
Result FSUSER_GetLegacyRomHeader2 | ( | u32 | headerSize, |
FS_MediaType | mediaType, | ||
u64 | programId, | ||
void * | header | ||
) |
Gets the legacy ROM header of a program.
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. |
Result FSUSER_GetLegacySubBannerData | ( | u32 | bannerSize, |
FS_MediaType | mediaType, | ||
u64 | programId, | ||
void * | banner | ||
) |
Gets the legacy sub banner data of a program.
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. |
Result FSUSER_GetMediaType | ( | FS_MediaType * | mediaType | ) |
Gets the media type of the current application.
mediaType | Pointer to output the media type to. |
Result FSUSER_GetNandArchiveResource | ( | FS_ArchiveResource * | archiveResource | ) |
Gets the NAND archive resource information.
archiveResource | Pointer to output the archive resource information to. |
Gets the NAND CID.
out | Pointer to output the CID to. |
length | Length of the CID buffer. (should be 0x10) |
Gets the NAND log.
out | Pointer to output the log to. |
length | Length of the log buffer. |
Result FSUSER_GetNandSpeedInfo | ( | FS_SdMmcSpeedInfo * | speedInfo | ) |
Gets the NAND speed info.
speedInfo | Pointer to output the speed info to. |
Gets the file system priority.
priority | Pointer to output the priority to. |
Result FSUSER_GetProductInfo | ( | FS_ProductInfo * | info, |
u32 | processId | ||
) |
Gets a process's product info.
info | Pointer to output the product info to. |
processId | ID of the process. |
Result FSUSER_GetProgramLaunchInfo | ( | FS_ProgramInfo * | info, |
u32 | processId | ||
) |
Gets a process's program launch info.
info | Pointer to output the program launch info to. |
processId | ID of the process. |
Result FSUSER_GetSaveDataSecureValue | ( | bool * | exists, |
u64 * | value, | ||
FS_SecureValueSlot | slot, | ||
u32 | titleUniqueId, | ||
u8 | titleVariation | ||
) |
Gets the save data secure value.
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) |
Result FSUSER_GetSdmcArchiveResource | ( | FS_ArchiveResource * | archiveResource | ) |
Gets the SDMC archive resource information.
archiveResource | Pointer to output the archive resource information to. |
Gets the SDMC CID.
out | Pointer to output the CID to. |
length | Length of the CID buffer. (should be 0x10) |
Gets the CTR SDMC root path.
out | Pointer to output the root path to. |
length | Length of the output buffer. |
Gets the last SDMC fatfs error.
error | Pointer to output the error to. |
Gets the SDMC log.
out | Pointer to output the log to. |
length | Length of the log buffer. |
Result FSUSER_GetSdmcSpeedInfo | ( | FS_SdMmcSpeedInfo * | speedInfo | ) |
Gets the SDMC speed info.
speedInfo | Pointer to output the speed info to. |
Result FSUSER_GetSpecialContentIndex | ( | u16 * | index, |
FS_MediaType | mediaType, | ||
u64 | programId, | ||
FS_SpecialContentType | type | ||
) |
Gets a special content's index.
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. |
Gets the size of a special file.
fileSize | Pointer to output the size to. |
Result FSUSER_ImportIntegrityVerificationSeed | ( | FS_IntegrityVerificationSeed * | seed | ) |
Imports an integrity verification seed.
seed | Seed to import. |
Initializes a FSUSER session.
session | The handle of the FSUSER session to initialize. |
Initializes a FSUSER session with an SDK version.
session | The handle of the FSUSER session to initialize. |
version | SDK version to initialize with. |
Result FSUSER_IsSdmcDetected | ( | bool * | detected | ) |
Gets whether an SD card is detected.
detected | Pointer to output the detection status to. |
Result FSUSER_IsSdmcWritable | ( | bool * | writable | ) |
Gets whether the SD card is writable.
writable | Pointer to output the writable status to. |
Result FSUSER_OpenArchive | ( | FS_Archive * | archive, |
FS_ArchiveID | id, | ||
FS_Path | path | ||
) |
Opens an archive.
archive | Pointer to output the opened archive to. |
id | ID of the archive. |
path | Path of the archive. |
Result FSUSER_OpenDirectory | ( | Handle * | out, |
FS_Archive | archive, | ||
FS_Path | path | ||
) |
Opens a directory.
out | Pointer to output the directory handle to. |
archive | Archive containing the directory. |
path | Path of the directory. |
Result FSUSER_OpenFile | ( | Handle * | out, |
FS_Archive | archive, | ||
FS_Path | path, | ||
u32 | openFlags, | ||
u32 | attributes | ||
) |
Opens a file.
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. |
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.
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. |
Result FSUSER_QueryTotalQuotaSize | ( | u64 * | quotaSize, |
u32 | directories, | ||
u32 | files, | ||
u32 | fileSizeCount, | ||
u64 * | fileSizes | ||
) |
Queries the total quota size of a save data archive.
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. |
Result FSUSER_ReadExtSaveDataIcon | ( | u32 * | bytesRead, |
FS_ExtSaveDataInfo | info, | ||
u32 | smdhSize, | ||
u8 * | smdh | ||
) |
Reads the SMDH icon of ext save data.
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. |
Reads from a special file.
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. |
Result FSUSER_RenameDirectory | ( | FS_Archive | srcArchive, |
FS_Path | srcPath, | ||
FS_Archive | dstArchive, | ||
FS_Path | dstPath | ||
) |
Renames a directory.
srcArchive | Archive containing the source directory. |
srcPath | Path of the source directory. |
dstArchive | Archive containing the destination directory. |
dstPath | Path of the destination directory. |
Result FSUSER_RenameFile | ( | FS_Archive | srcArchive, |
FS_Path | srcPath, | ||
FS_Archive | dstArchive, | ||
FS_Path | dstPath | ||
) |
Renames a file.
srcArchive | Archive containing the source file. |
srcPath | Path of the source file. |
dstArchive | Archive containing the destination file. |
dstPath | Path of the destination file. |
Result FSUSER_SetArchivePriority | ( | FS_Archive | archive, |
u32 | priority | ||
) |
Sets an archive's priority.
archive | Archive to use. |
priority | Priority to set. |
Result FSUSER_SetCardSpiBaudRate | ( | FS_CardSpiBaudRate | baudRate | ) |
Sets the CARDSPI baud rate.
baudRate | Baud rate to set. |
Result FSUSER_SetCardSpiBusMode | ( | FS_CardSpiBusMode | busMode | ) |
Sets the CARDSPI bus mode.
busMode | Bus mode to set. |
Configures CTRCARD latency emulation.
latency | Latency to apply, in milliseconds. |
emulateEndurance | Whether to emulate card endurance. |
Sets the file system priority.
priority | Priority to set. |
Result FSUSER_SetSaveDataSecureValue | ( | u64 | value, |
FS_SecureValueSlot | slot, | ||
u32 | titleUniqueId, | ||
u8 | titleVariation | ||
) |
Sets the save data secure value.
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) |
Result FSUSER_StartDeviceMoveAsDestination | ( | FS_DeviceMoveContext | context, |
bool | clear | ||
) |
Initiates a device move as the destination device.
context | Context to use. |
clear | Whether to clear the device's data first. |
Result FSUSER_StartDeviceMoveAsSource | ( | FS_DeviceMoveContext * | context | ) |
Initiates a device move as the source device.
context | Pointer to output the context to. |
Result FSUSER_SwitchCleanupInvalidSaveData | ( | bool | enable | ) |
Toggles cleaning up invalid save data.
enable | Whether to enable cleaning up invalid save data. |
Hashes the given data and outputs a SHA256 hash.
data | Pointer to the data to be hashed. |
inputSize | The size of the data. |
hash | Hash output pointer. |
void fsUseSession | ( | Handle | session | ) |
Sets the FSUSER session to use in the current thread.
session | The handle of the FSUSER session to use. |