libnx  v4.7.0
Data Structures | Macros | Enumerations | Functions
fs.h File Reference

Filesystem (fsp-srv) service IPC wrapper. More...

#include "../types.h"
#include "../kernel/event.h"
#include "../services/ncm_types.h"
#include "../services/acc.h"
#include "../sf/service.h"

Go to the source code of this file.

Data Structures

struct  FsRightsId
 
struct  FsFileSystem
 
struct  FsFile
 
struct  FsDir
 
struct  FsStorage
 
struct  FsSaveDataInfoReader
 
struct  FsEventNotifier
 
struct  FsDeviceOperator
 
struct  FsDirectoryEntry
 Directory entry. More...
 
struct  FsSaveDataAttribute
 SaveDataAttribute. More...
 
struct  FsSaveDataExtraData
 SaveDataExtraData. More...
 
struct  FsSaveDataMetaInfo
 SaveDataMetaInfo. More...
 
struct  FsSaveDataCreationInfo
 SaveDataCreationInfo. More...
 
struct  FsSaveDataInfo
 SaveDataInfo. More...
 
struct  FsSaveDataFilter
 SaveDataFilter. More...
 
struct  FsTimeStampRaw
 
struct  FsArchiveMacKey
 This is nn::fssystem::ArchiveMacKey. Used by setsysGetThemeKey and setsysSetThemeKey. Does not appear to be in use elsewhere. More...
 
struct  FsGameCardHandle
 
struct  FsGameCardUpdatePartitionInfo
 
struct  FsRangeInfo
 
struct  FsFileSystemAttribute
 FileSystemAttribute. More...
 
struct  FsStorageErrorInfo
 FsStorageErrorInfo. More...
 
struct  FatFatError
 FatFatError. More...
 
struct  FatFatReportInfo1
 FatFatReportInfo1. More...
 
struct  FatFatReportInfo2
 FatFatReportInfo2. More...
 
struct  FatFatSafeInfo
 FatFatSafeInfo. More...
 
struct  FsFileSystemProxyErrorInfo
 FsFileSystemProxyErrorInfo. More...
 
struct  FsMemoryReportInfo
 FsMemoryReportInfo. More...
 
struct  FsGameCardErrorReportInfo
 FsGameCardErrorReportInfo. More...
 

Macros

#define FS_MAX_PATH   0x301
 
#define FS_SAVEDATA_CURRENT_APPLICATIONID   0
 For use with FsSaveDataAttribute.
 

Enumerations

enum  FsDirEntryType {
  FsDirEntryType_Dir = 0 ,
  FsDirEntryType_File = 1
}
 Returned by fsFsGetEntryType. More...
 
enum  FsOpenMode {
  FsOpenMode_Read = (1U<<( 0 )) ,
  FsOpenMode_Write = (1U<<( 1 )) ,
  FsOpenMode_Append = (1U<<( 2 ))
}
 For use with fsFsOpenFile. More...
 
enum  FsCreateOption { FsCreateOption_BigFile = (1U<<( 0 )) }
 For use with fsFsCreateFile. More...
 
enum  FsDirOpenMode {
  FsDirOpenMode_ReadDirs = (1U<<( 0 )) ,
  FsDirOpenMode_ReadFiles = (1U<<( 1 )) ,
  FsDirOpenMode_NoFileSize = (1U<<( 31 ))
}
 For use with fsFsOpenDirectory. More...
 
enum  FsReadOption { FsReadOption_None = 0 }
 For use with fsFileRead. More...
 
enum  FsWriteOption {
  FsWriteOption_None = 0 ,
  FsWriteOption_Flush = (1U<<( 0 ))
}
 For use with fsFileWrite. More...
 
enum  FsContentStorageId {
  FsContentStorageId_System = 0 ,
  FsContentStorageId_User = 1 ,
  FsContentStorageId_SdCard = 2 ,
  FsContentStorageId_System0 = 3
}
 
enum  FsCustomStorageId {
  FsCustomStorageId_System = 0 ,
  FsCustomStorageId_SdCard = 1
}
 
enum  FsImageDirectoryId {
  FsImageDirectoryId_Nand = 0 ,
  FsImageDirectoryId_Sd = 1
}
 ImageDirectoryId.
 
enum  FsSaveDataSpaceId {
  FsSaveDataSpaceId_System = 0 ,
  FsSaveDataSpaceId_User = 1 ,
  FsSaveDataSpaceId_SdSystem = 2 ,
  FsSaveDataSpaceId_Temporary = 3 ,
  FsSaveDataSpaceId_SdUser = 4 ,
  FsSaveDataSpaceId_ProperSystem = 100 ,
  FsSaveDataSpaceId_SafeMode = 101 ,
  FsSaveDataSpaceId_All = -1
}
 SaveDataSpaceId. More...
 
enum  FsSaveDataType {
  FsSaveDataType_System = 0 ,
  FsSaveDataType_Account = 1 ,
  FsSaveDataType_Bcat = 2 ,
  FsSaveDataType_Device = 3 ,
  FsSaveDataType_Temporary = 4 ,
  FsSaveDataType_Cache = 5 ,
  FsSaveDataType_SystemBcat = 6
}
 SaveDataType. More...
 
enum  FsSaveDataRank {
  FsSaveDataRank_Primary = 0 ,
  FsSaveDataRank_Secondary = 1
}
 SaveDataRank. More...
 
enum  FsSaveDataFlags {
  FsSaveDataFlags_KeepAfterResettingSystemSaveData = (1U<<( 0 )) ,
  FsSaveDataFlags_KeepAfterRefurbishment = (1U<<( 1 )) ,
  FsSaveDataFlags_KeepAfterResettingSystemSaveDataWithoutUserSaveData = (1U<<( 2 )) ,
  FsSaveDataFlags_NeedsSecureDelete = (1U<<( 3 ))
}
 SaveDataFlags.
 
enum  FsSaveDataMetaType {
  FsSaveDataMetaType_None = 0 ,
  FsSaveDataMetaType_Thumbnail = 1 ,
  FsSaveDataMetaType_ExtensionContext = 2
}
 SaveDataMetaType.
 
enum  FsGameCardAttribute {
  FsGameCardAttribute_AutoBootFlag = (1U<<( 0 )) ,
  FsGameCardAttribute_HistoryEraseFlag = (1U<<( 1 )) ,
  FsGameCardAttribute_RepairToolFlag = (1U<<( 2 )) ,
  FsGameCardAttribute_DifferentRegionCupToTerraDeviceFlag = (1U<<( 3 )) ,
  FsGameCardAttribute_DifferentRegionCupToGlobalDeviceFlag = (1U<<( 4 ))
}
 
enum  FsGameCardPartition {
  FsGameCardPartition_Update = 0 ,
  FsGameCardPartition_Normal = 1 ,
  FsGameCardPartition_Secure = 2 ,
  FsGameCardPartition_Logo = 3
}
 
enum  FsOperationId {
  FsOperationId_Clear ,
  FsOperationId_ClearSignature ,
  FsOperationId_InvalidateCache ,
  FsOperationId_QueryRange
}
 
enum  FsBisPartitionId {
  FsBisPartitionId_BootPartition1Root = 0 ,
  FsBisPartitionId_BootPartition2Root = 10 ,
  FsBisPartitionId_UserDataRoot = 20 ,
  FsBisPartitionId_BootConfigAndPackage2Part1 = 21 ,
  FsBisPartitionId_BootConfigAndPackage2Part2 = 22 ,
  FsBisPartitionId_BootConfigAndPackage2Part3 = 23 ,
  FsBisPartitionId_BootConfigAndPackage2Part4 = 24 ,
  FsBisPartitionId_BootConfigAndPackage2Part5 = 25 ,
  FsBisPartitionId_BootConfigAndPackage2Part6 = 26 ,
  FsBisPartitionId_CalibrationBinary = 27 ,
  FsBisPartitionId_CalibrationFile = 28 ,
  FsBisPartitionId_SafeMode = 29 ,
  FsBisPartitionId_User = 30 ,
  FsBisPartitionId_System = 31 ,
  FsBisPartitionId_SystemProperEncryption = 32 ,
  FsBisPartitionId_SystemProperPartition = 33 ,
  FsBisPartitionId_SignedSystemPartitionOnSafeMode = 34 ,
  FsBisPartitionId_DeviceTreeBlob = 35 ,
  FsBisPartitionId_System0 = 36
}
 BisPartitionId.
 
enum  FsFileSystemType {
  FsFileSystemType_Logo = 2 ,
  FsFileSystemType_ContentControl = 3 ,
  FsFileSystemType_ContentManual = 4 ,
  FsFileSystemType_ContentMeta = 5 ,
  FsFileSystemType_ContentData = 6 ,
  FsFileSystemType_ApplicationPackage = 7 ,
  FsFileSystemType_RegisteredUpdate = 8
}
 FileSystemType. More...
 
enum  FsFileSystemQueryId {
  FsFileSystemQueryId_SetConcatenationFileAttribute = 0 ,
  FsFileSystemQueryId_IsValidSignedSystemPartitionOnSdCard = 2
}
 FileSystemQueryId. More...
 
enum  FsPriority {
  FsPriority_Normal = 0 ,
  FsPriority_Realtime = 1 ,
  FsPriority_Low = 2 ,
  FsPriority_Background = 3
}
 FsPriority.
 
enum  FsContentAttributes {
  FsContentAttributes_None = 0x0 ,
  FsContentAttributes_All = 0xF
}
 FsContentAttributes.
 
enum  FsMountHostOption {
  FsMountHostOptionFlag_None = 0 ,
  FsMountHostOptionFlag_PseudoCaseSensitive = (1U<<( 0 ))
}
 For use with fsOpenHostFileSystemWithOption. More...
 

Functions

Result fsInitialize (void)
 Initialize fsp-srv. Used automatically during app startup.
 
void fsExit (void)
 Exit fsp-srv. Used automatically during app exit.
 
ServicefsGetServiceSession (void)
 Gets the Service object for the actual fsp-srv service session.
 
void fsSetPriority (FsPriority prio)
 [5.0.0+] Configures the FsPriority of all filesystem commands issued within the current thread.
 
Result fsOpenFileSystem (FsFileSystem *out, FsFileSystemType fsType, const char *contentPath)
 Mount requested filesystem type from content file. More...
 
Result fsOpenDataFileSystemByCurrentProcess (FsFileSystem *out)
 
Result fsOpenFileSystemWithPatch (FsFileSystem *out, u64 id, FsFileSystemType fsType)
 [2.0.0+], like OpenFileSystemWithId but without content path.
 
Result fsOpenFileSystemWithId (FsFileSystem *out, u64 id, FsFileSystemType fsType, const char *contentPath, FsContentAttributes attr)
 works on all firmwares, id is ignored on [1.0.0], attr is ignored before [16.0.0]
 
Result fsOpenDataFileSystemByProgramId (FsFileSystem *out, u64 program_id)
 [3.0.0+]
 
Result fsOpenBisFileSystem (FsFileSystem *out, FsBisPartitionId partitionId, const char *string)
 
Result fsOpenBisStorage (FsStorage *out, FsBisPartitionId partitionId)
 
Result fsOpenSdCardFileSystem (FsFileSystem *out)
 Do not call this directly, see fs_dev.h.
 
Result fsOpenHostFileSystem (FsFileSystem *out, const char *path)
 
Result fsOpenHostFileSystemWithOption (FsFileSystem *out, const char *path, u32 flags)
 [9.0.0+]
 
Result fsDeleteSaveDataFileSystem (u64 application_id)
 
Result fsCreateSaveDataFileSystem (const FsSaveDataAttribute *attr, const FsSaveDataCreationInfo *creation_info, const FsSaveDataMetaInfo *meta)
 
Result fsCreateSaveDataFileSystemBySystemSaveDataId (const FsSaveDataAttribute *attr, const FsSaveDataCreationInfo *creation_info)
 
Result fsDeleteSaveDataFileSystemBySaveDataSpaceId (FsSaveDataSpaceId save_data_space_id, u64 saveID)
 [2.0.0+]
 
Result fsDeleteSaveDataFileSystemBySaveDataAttribute (FsSaveDataSpaceId save_data_space_id, const FsSaveDataAttribute *attr)
 [4.0.0+]
 
Result fsIsExFatSupported (bool *out)
 
Result fsOpenGameCardFileSystem (FsFileSystem *out, const FsGameCardHandle *handle, FsGameCardPartition partition)
 
Result fsExtendSaveDataFileSystem (FsSaveDataSpaceId save_data_space_id, u64 saveID, s64 dataSize, s64 journalSize)
 [3.0.0+]
 
Result fsOpenSaveDataFileSystem (FsFileSystem *out, FsSaveDataSpaceId save_data_space_id, const FsSaveDataAttribute *attr)
 
Result fsOpenSaveDataFileSystemBySystemSaveDataId (FsFileSystem *out, FsSaveDataSpaceId save_data_space_id, const FsSaveDataAttribute *attr)
 
Result fsOpenReadOnlySaveDataFileSystem (FsFileSystem *out, FsSaveDataSpaceId save_data_space_id, const FsSaveDataAttribute *attr)
 [2.0.0+].
 
Result fsReadSaveDataFileSystemExtraDataBySaveDataSpaceId (void *buf, size_t len, FsSaveDataSpaceId save_data_space_id, u64 saveID)
 
Result fsReadSaveDataFileSystemExtraData (void *buf, size_t len, u64 saveID)
 
Result fsWriteSaveDataFileSystemExtraData (const void *buf, size_t len, FsSaveDataSpaceId save_data_space_id, u64 saveID)
 
Result fsOpenSaveDataInfoReader (FsSaveDataInfoReader *out, FsSaveDataSpaceId save_data_space_id)
 
Result fsOpenSaveDataInfoReaderWithFilter (FsSaveDataInfoReader *out, FsSaveDataSpaceId save_data_space_id, const FsSaveDataFilter *save_data_filter)
 [6.0.0+]
 
Result fsOpenImageDirectoryFileSystem (FsFileSystem *out, FsImageDirectoryId image_directory_id)
 
Result fsOpenContentStorageFileSystem (FsFileSystem *out, FsContentStorageId content_storage_id)
 
Result fsOpenCustomStorageFileSystem (FsFileSystem *out, FsCustomStorageId custom_storage_id)
 [7.0.0+]
 
Result fsOpenDataStorageByCurrentProcess (FsStorage *out)
 
Result fsOpenDataStorageByProgramId (FsStorage *out, u64 program_id)
 
Result fsOpenDataStorageByDataId (FsStorage *out, u64 dataId, NcmStorageId storageId)
 <[3.0.0+]
 
Result fsOpenPatchDataStorageByCurrentProcess (FsStorage *out)
 
Result fsOpenDeviceOperator (FsDeviceOperator *out)
 
Result fsOpenSdCardDetectionEventNotifier (FsEventNotifier *out)
 
Result fsIsSignedSystemPartitionOnSdCardValid (bool *out)
 
Result fsGetProgramId (u64 *out, const char *path, FsContentAttributes attr)
 [17.0.0+]
 
Result fsGetRightsIdByPath (const char *path, FsRightsId *out_rights_id)
 Retrieves the rights id corresponding to the content path. Only available on [2.0.0-15.0.1].
 
Result fsGetRightsIdAndKeyGenerationByPath (const char *path, FsContentAttributes attr, u8 *out_key_generation, FsRightsId *out_rights_id)
 Retrieves the rights id and key generation corresponding to the content path. Only available on [3.0.0+], attr is ignored before [16.0.0].
 
Result fsDisableAutoSaveDataCreation (void)
 
Result fsSetGlobalAccessLogMode (u32 mode)
 
Result fsGetGlobalAccessLogMode (u32 *out_mode)
 
Result fsOutputAccessLogToSdCard (const char *log, size_t size)
 
Result fsGetAndClearErrorInfo (FsFileSystemProxyErrorInfo *out)
 [2.0.0+]
 
Result fsGetAndClearMemoryReportInfo (FsMemoryReportInfo *out)
 [4.0.0+]
 
Result fsGetProgramIndexForAccessLog (u32 *out_program_index, u32 *out_program_count)
 Only available on [7.0.0+].
 
Result fsCreate_TemporaryStorage (u64 application_id, u64 owner_id, s64 size, u32 flags)
 
Result fsCreate_SystemSaveDataWithOwner (FsSaveDataSpaceId save_data_space_id, u64 system_save_data_id, AccountUid uid, u64 owner_id, s64 size, s64 journal_size, u32 flags)
 
Result fsCreate_SystemSaveData (FsSaveDataSpaceId save_data_space_id, u64 system_save_data_id, s64 size, s64 journal_size, u32 flags)
 
Result fsOpen_SaveData (FsFileSystem *out, u64 application_id, AccountUid uid)
 Wrapper for fsOpenSaveDataFileSystem. More...
 
Result fsOpen_SaveDataReadOnly (FsFileSystem *out, u64 application_id, AccountUid uid)
 Wrapper for fsOpenReadOnlySaveDataFileSystem. More...
 
Result fsOpen_BcatSaveData (FsFileSystem *out, u64 application_id)
 Wrapper for fsOpenSaveDataFileSystem, for opening BcatSaveData.
 
Result fsOpen_DeviceSaveData (FsFileSystem *out, u64 application_id)
 Wrapper for fsOpenSaveDataFileSystem, for opening DeviceSaveData. More...
 
Result fsOpen_TemporaryStorage (FsFileSystem *out)
 Wrapper for fsOpenSaveDataFileSystem, for opening TemporaryStorage. More...
 
Result fsOpen_CacheStorage (FsFileSystem *out, u64 application_id, u16 save_data_index)
 Wrapper for fsOpenSaveDataFileSystem, for opening CacheStorage. More...
 
Result fsOpen_SystemSaveData (FsFileSystem *out, FsSaveDataSpaceId save_data_space_id, u64 system_save_data_id, AccountUid uid)
 Wrapper for fsOpenSaveDataFileSystemBySystemSaveDataId, for opening SystemSaveData. More...
 
Result fsOpen_SystemBcatSaveData (FsFileSystem *out, u64 system_save_data_id)
 Wrapper for fsOpenSaveDataFileSystemBySystemSaveDataId, for opening SystemBcatSaveData. More...
 
Result fsFsCreateFile (FsFileSystem *fs, const char *path, s64 size, u32 option)
 
Result fsFsDeleteFile (FsFileSystem *fs, const char *path)
 
Result fsFsCreateDirectory (FsFileSystem *fs, const char *path)
 
Result fsFsDeleteDirectory (FsFileSystem *fs, const char *path)
 
Result fsFsDeleteDirectoryRecursively (FsFileSystem *fs, const char *path)
 
Result fsFsRenameFile (FsFileSystem *fs, const char *cur_path, const char *new_path)
 
Result fsFsRenameDirectory (FsFileSystem *fs, const char *cur_path, const char *new_path)
 
Result fsFsGetEntryType (FsFileSystem *fs, const char *path, FsDirEntryType *out)
 
Result fsFsOpenFile (FsFileSystem *fs, const char *path, u32 mode, FsFile *out)
 
Result fsFsOpenDirectory (FsFileSystem *fs, const char *path, u32 mode, FsDir *out)
 
Result fsFsCommit (FsFileSystem *fs)
 
Result fsFsGetFreeSpace (FsFileSystem *fs, const char *path, s64 *out)
 
Result fsFsGetTotalSpace (FsFileSystem *fs, const char *path, s64 *out)
 
Result fsFsGetFileTimeStampRaw (FsFileSystem *fs, const char *path, FsTimeStampRaw *out)
 [3.0.0+]
 
Result fsFsCleanDirectoryRecursively (FsFileSystem *fs, const char *path)
 [3.0.0+]
 
Result fsFsQueryEntry (FsFileSystem *fs, void *out, size_t out_size, const void *in, size_t in_size, const char *path, FsFileSystemQueryId query_id)
 [4.0.0+]
 
Result fsFsGetFileSystemAttribute (FsFileSystem *fs, FsFileSystemAttribute *out)
 [15.0.0+]
 
void fsFsClose (FsFileSystem *fs)
 
Result fsFsSetConcatenationFileAttribute (FsFileSystem *fs, const char *path)
 Uses fsFsQueryEntry to set the archive bit on the specified absolute directory path. More...
 
Result fsFsIsValidSignedSystemPartitionOnSdCard (FsFileSystem *fs, bool *out)
 Wrapper for fsFsQueryEntry with FsFileSystemQueryId_IsValidSignedSystemPartitionOnSdCard. More...
 
Result fsFileRead (FsFile *f, s64 off, void *buf, u64 read_size, u32 option, u64 *bytes_read)
 
Result fsFileWrite (FsFile *f, s64 off, const void *buf, u64 write_size, u32 option)
 
Result fsFileFlush (FsFile *f)
 
Result fsFileSetSize (FsFile *f, s64 sz)
 
Result fsFileGetSize (FsFile *f, s64 *out)
 
Result fsFileOperateRange (FsFile *f, FsOperationId op_id, s64 off, s64 len, FsRangeInfo *out)
 [4.0.0+]
 
void fsFileClose (FsFile *f)
 
Result fsDirRead (FsDir *d, s64 *total_entries, size_t max_entries, FsDirectoryEntry *buf)
 
Result fsDirGetEntryCount (FsDir *d, s64 *count)
 
void fsDirClose (FsDir *d)
 
Result fsStorageRead (FsStorage *s, s64 off, void *buf, u64 read_size)
 
Result fsStorageWrite (FsStorage *s, s64 off, const void *buf, u64 write_size)
 
Result fsStorageFlush (FsStorage *s)
 
Result fsStorageSetSize (FsStorage *s, s64 sz)
 
Result fsStorageGetSize (FsStorage *s, s64 *out)
 
Result fsStorageOperateRange (FsStorage *s, FsOperationId op_id, s64 off, s64 len, FsRangeInfo *out)
 [4.0.0+]
 
void fsStorageClose (FsStorage *s)
 
Result fsSaveDataInfoReaderRead (FsSaveDataInfoReader *s, FsSaveDataInfo *buf, size_t max_entries, s64 *total_entries)
 Read FsSaveDataInfo data into the buf array.
 
void fsSaveDataInfoReaderClose (FsSaveDataInfoReader *s)
 
Result fsEventNotifierGetEventHandle (FsEventNotifier *e, Event *out, bool autoclear)
 
void fsEventNotifierClose (FsEventNotifier *e)
 
Result fsDeviceOperatorIsSdCardInserted (FsDeviceOperator *d, bool *out)
 
Result fsDeviceOperatorGetSdCardSpeedMode (FsDeviceOperator *d, s64 *out)
 
Result fsDeviceOperatorGetSdCardCid (FsDeviceOperator *d, void *dst, size_t dst_size, s64 size)
 
Result fsDeviceOperatorGetSdCardUserAreaSize (FsDeviceOperator *d, s64 *out)
 
Result fsDeviceOperatorGetSdCardProtectedAreaSize (FsDeviceOperator *d, s64 *out)
 
Result fsDeviceOperatorGetAndClearSdCardErrorInfo (FsDeviceOperator *d, FsStorageErrorInfo *out, s64 *out_log_size, void *dst, size_t dst_size, s64 size)
 
Result fsDeviceOperatorGetMmcCid (FsDeviceOperator *d, void *dst, size_t dst_size, s64 size)
 
Result fsDeviceOperatorGetMmcSpeedMode (FsDeviceOperator *d, s64 *out)
 
Result fsDeviceOperatorGetMmcPatrolCount (FsDeviceOperator *d, u32 *out)
 
Result fsDeviceOperatorGetAndClearMmcErrorInfo (FsDeviceOperator *d, FsStorageErrorInfo *out, s64 *out_log_size, void *dst, size_t dst_size, s64 size)
 
Result fsDeviceOperatorGetMmcExtendedCsd (FsDeviceOperator *d, void *dst, size_t dst_size, s64 size)
 
Result fsDeviceOperatorIsGameCardInserted (FsDeviceOperator *d, bool *out)
 
Result fsDeviceOperatorGetGameCardHandle (FsDeviceOperator *d, FsGameCardHandle *out)
 
Result fsDeviceOperatorGetGameCardUpdatePartitionInfo (FsDeviceOperator *d, const FsGameCardHandle *handle, FsGameCardUpdatePartitionInfo *out)
 
Result fsDeviceOperatorGetGameCardAttribute (FsDeviceOperator *d, const FsGameCardHandle *handle, u8 *out)
 
Result fsDeviceOperatorGetGameCardDeviceCertificate (FsDeviceOperator *d, const FsGameCardHandle *handle, void *dst, size_t dst_size, s64 size)
 
Result fsDeviceOperatorGetGameCardIdSet (FsDeviceOperator *d, void *dst, size_t dst_size, s64 size)
 
Result fsDeviceOperatorGetGameCardErrorReportInfo (FsDeviceOperator *d, FsGameCardErrorReportInfo *out)
 
Result fsDeviceOperatorGetGameCardDeviceId (FsDeviceOperator *d, void *dst, size_t dst_size, s64 size)
 
Result fsDeviceOperatorChallengeCardExistence (FsDeviceOperator *d, const FsGameCardHandle *handle, void *dst, size_t dst_size, void *seed, size_t seed_size, void *value, size_t value_size)
 
void fsDeviceOperatorClose (FsDeviceOperator *d)
 

Detailed Description

Filesystem (fsp-srv) service IPC wrapper.

SSL service IPC wrapper, for using client-mode TLS.

Normally applications should just use standard stdio not FS-serv directly. However this can be used if obtaining a FsFileSystem, FsFile, or FsStorage, for mounting with fs_dev/romfs_dev, etc.

Author
plutoo
yellows8

See also: https://switchbrew.org/wiki/SSL_services

Author
yellows8

Enumeration Type Documentation

◆ FsContentStorageId

Enumerator
FsContentStorageId_System 

System.

FsContentStorageId_User 

User.

FsContentStorageId_SdCard 

SdCard.

FsContentStorageId_System0 

[16.0.0+] System0

◆ FsCreateOption

For use with fsFsCreateFile.

Enumerator
FsCreateOption_BigFile 

Creates a ConcatenationFile (dir with archive bit) instead of file.

◆ FsDirEntryType

Returned by fsFsGetEntryType.

Enumerator
FsDirEntryType_Dir 

Entry is a directory.

FsDirEntryType_File 

Entry is a file.

◆ FsDirOpenMode

For use with fsFsOpenDirectory.

Enumerator
FsDirOpenMode_ReadDirs 

Enable reading directory entries.

FsDirOpenMode_ReadFiles 

Enable reading file entries.

FsDirOpenMode_NoFileSize 

Causes result entries to not contain filesize information (always 0).

◆ FsFileSystemQueryId

FileSystemQueryId.

Enumerator
FsFileSystemQueryId_SetConcatenationFileAttribute 

[4.0.0+]

FsFileSystemQueryId_IsValidSignedSystemPartitionOnSdCard 

[8.0.0+]

◆ FsFileSystemType

FileSystemType.

Enumerator
FsFileSystemType_Logo 

Logo.

FsFileSystemType_ContentControl 

ContentControl.

FsFileSystemType_ContentManual 

ContentManual.

FsFileSystemType_ContentMeta 

ContentMeta.

FsFileSystemType_ContentData 

ContentData.

FsFileSystemType_ApplicationPackage 

ApplicationPackage.

FsFileSystemType_RegisteredUpdate 

[4.0.0+] RegisteredUpdate

◆ FsGameCardAttribute

Enumerator
FsGameCardAttribute_AutoBootFlag 

Causes the cartridge to automatically start on bootup.

FsGameCardAttribute_HistoryEraseFlag 

Causes NS to throw an error on attempt to load the cartridge.

FsGameCardAttribute_RepairToolFlag 

[4.0.0+] Indicates that this gamecard is a repair tool.

FsGameCardAttribute_DifferentRegionCupToTerraDeviceFlag 

[9.0.0+] DifferentRegionCupToTerraDeviceFlag

FsGameCardAttribute_DifferentRegionCupToGlobalDeviceFlag 

[9.0.0+] DifferentRegionCupToGlobalDeviceFlag

◆ FsGameCardPartition

Enumerator
FsGameCardPartition_Logo 

[4.0.0+]

◆ FsMountHostOption

For use with fsOpenHostFileSystemWithOption.

Enumerator
FsMountHostOptionFlag_None 

Host filesystem will be case insensitive.

FsMountHostOptionFlag_PseudoCaseSensitive 

Host filesystem will be pseudo case sensitive.

◆ FsOpenMode

enum FsOpenMode

For use with fsFsOpenFile.

Enumerator
FsOpenMode_Read 

Open for reading.

FsOpenMode_Write 

Open for writing.

FsOpenMode_Append 

Append file.

◆ FsOperationId

Enumerator
FsOperationId_Clear 

Fill range with zero for supported file/storage.

FsOperationId_ClearSignature 

Clears signature for supported file/storage.

FsOperationId_InvalidateCache 

Invalidates cache for supported file/storage.

FsOperationId_QueryRange 

Retrieves information on data for supported file/storage.

◆ FsReadOption

For use with fsFileRead.

Enumerator
FsReadOption_None 

No option.

◆ FsSaveDataRank

SaveDataRank.

Enumerator
FsSaveDataRank_Primary 

Primary.

FsSaveDataRank_Secondary 

Secondary.

◆ FsSaveDataSpaceId

SaveDataSpaceId.

Enumerator
FsSaveDataSpaceId_System 

System.

FsSaveDataSpaceId_User 

User.

FsSaveDataSpaceId_SdSystem 

SdSystem.

FsSaveDataSpaceId_Temporary 

[3.0.0+] Temporary

FsSaveDataSpaceId_SdUser 

[4.0.0+] SdUser

FsSaveDataSpaceId_ProperSystem 

[3.0.0+] ProperSystem

FsSaveDataSpaceId_SafeMode 

[3.0.0+] SafeMode

FsSaveDataSpaceId_All 

Pseudo value for fsOpenSaveDataInfoReader().

◆ FsSaveDataType

SaveDataType.

Enumerator
FsSaveDataType_System 

System.

FsSaveDataType_Account 

Account.

FsSaveDataType_Bcat 

Bcat.

FsSaveDataType_Device 

Device.

FsSaveDataType_Temporary 

[3.0.0+] Temporary

FsSaveDataType_Cache 

[3.0.0+] Cache

FsSaveDataType_SystemBcat 

[4.0.0+] SystemBcat

◆ FsWriteOption

For use with fsFileWrite.

Enumerator
FsWriteOption_None 

No option.

FsWriteOption_Flush 

Forces a flush after write.

Function Documentation

◆ fsFsIsValidSignedSystemPartitionOnSdCard()

Result fsFsIsValidSignedSystemPartitionOnSdCard ( FsFileSystem fs,
bool *  out 
)

Wrapper for fsFsQueryEntry with FsFileSystemQueryId_IsValidSignedSystemPartitionOnSdCard.

Only available on [8.0.0+].

◆ fsFsSetConcatenationFileAttribute()

Result fsFsSetConcatenationFileAttribute ( FsFileSystem fs,
const char *  path 
)

Uses fsFsQueryEntry to set the archive bit on the specified absolute directory path.

This will cause HOS to treat the directory as if it were a file containing the directory's concatenated contents.

◆ fsOpen_CacheStorage()

Result fsOpen_CacheStorage ( FsFileSystem out,
u64  application_id,
u16  save_data_index 
)

Wrapper for fsOpenSaveDataFileSystem, for opening CacheStorage.

Only available on [3.0.0+]. See FsSaveDataAttribute for application_id.

◆ fsOpen_DeviceSaveData()

Result fsOpen_DeviceSaveData ( FsFileSystem out,
u64  application_id 
)

Wrapper for fsOpenSaveDataFileSystem, for opening DeviceSaveData.

See FsSaveDataAttribute for application_id.

◆ fsOpen_SaveData()

Result fsOpen_SaveData ( FsFileSystem out,
u64  application_id,
AccountUid  uid 
)

Wrapper for fsOpenSaveDataFileSystem.

See FsSaveDataAttribute for application_id and uid.

◆ fsOpen_SaveDataReadOnly()

Result fsOpen_SaveDataReadOnly ( FsFileSystem out,
u64  application_id,
AccountUid  uid 
)

Wrapper for fsOpenReadOnlySaveDataFileSystem.

Only available on [2.0.0+]. See FsSaveDataAttribute for application_id and uid.

◆ fsOpen_SystemBcatSaveData()

Result fsOpen_SystemBcatSaveData ( FsFileSystem out,
u64  system_save_data_id 
)

Wrapper for fsOpenSaveDataFileSystemBySystemSaveDataId, for opening SystemBcatSaveData.

Only available on [4.0.0+].

◆ fsOpen_SystemSaveData()

Result fsOpen_SystemSaveData ( FsFileSystem out,
FsSaveDataSpaceId  save_data_space_id,
u64  system_save_data_id,
AccountUid  uid 
)

Wrapper for fsOpenSaveDataFileSystemBySystemSaveDataId, for opening SystemSaveData.

WARNING: You can brick when writing to SystemSaveData, if the data is corrupted etc.

◆ fsOpen_TemporaryStorage()

Result fsOpen_TemporaryStorage ( FsFileSystem out)

Wrapper for fsOpenSaveDataFileSystem, for opening TemporaryStorage.

Only available on [3.0.0+].

◆ fsOpenFileSystem()

Result fsOpenFileSystem ( FsFileSystem out,
FsFileSystemType  fsType,
const char *  contentPath 
)

Mount requested filesystem type from content file.

same as calling fsOpenFileSystemWithId with 0 as id