libnx  v4.2.2
fs.h
Go to the documentation of this file.
1 /**
2  * @file fs.h
3  * @brief Filesystem (fsp-srv) service IPC wrapper.
4  * 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.
5  * @author plutoo
6  * @author yellows8
7  * @copyright libnx Authors
8  */
9 #pragma once
10 #include "../types.h"
11 #include "../kernel/event.h"
12 #include "../services/ncm_types.h"
13 #include "../services/acc.h"
14 #include "../sf/service.h"
15 
16 // We use wrapped handles for type safety.
17 
18 #define FS_MAX_PATH 0x301
19 
20 /// For use with \ref FsSaveDataAttribute.
21 #define FS_SAVEDATA_CURRENT_APPLICATIONID 0
22 
23 typedef struct {
24  u8 c[0x10];
25 } FsRightsId;
26 
27 typedef struct {
28  Service s;
29 } FsFileSystem;
30 
31 typedef struct {
32  Service s;
33 } FsFile;
34 
35 typedef struct {
36  Service s;
37 } FsDir;
38 
39 typedef struct {
40  Service s;
41 } FsStorage;
42 
43 typedef struct {
44  Service s;
46 
47 typedef struct {
48  Service s;
50 
51 typedef struct {
52  Service s;
54 
55 /// Directory entry.
56 typedef struct {
57  char name[FS_MAX_PATH]; ///< Entry name.
58  u8 pad[3];
59  s8 type; ///< See FsDirEntryType.
60  u8 pad2[3]; ///< ?
61  s64 file_size; ///< File size.
63 
64 /// SaveDataAttribute
65 typedef struct {
66  u64 application_id; ///< ApplicationId of the savedata to access when accessing other programs' savedata via SaveData, otherwise FS_SAVEDATA_CURRENT_APPLICATIONID.
67  AccountUid uid; ///< \ref AccountUid for the user-specific savedata to access, otherwise 0 for common savedata.
68  u64 system_save_data_id; ///< SystemSaveDataId, 0 for ::FsSaveDataType_Account.
69  u8 save_data_type; ///< \ref FsSaveDataType
70  u8 save_data_rank; ///< \ref FsSaveDataRank
71  u16 save_data_index; ///< SaveDataIndex
72  u32 pad_x24; ///< Padding.
73  u64 unk_x28; ///< 0 for ::FsSaveDataType_System/::FsSaveDataType_Account.
74  u64 unk_x30; ///< 0 for ::FsSaveDataType_System/::FsSaveDataType_Account.
75  u64 unk_x38; ///< 0 for ::FsSaveDataType_System/::FsSaveDataType_Account.
77 
78 /// SaveDataExtraData
79 typedef struct {
80  FsSaveDataAttribute attr; ///< \ref FsSaveDataAttribute
81  u64 owner_id; ///< ProgramId of the owner of this save data. 0 for ::FsSaveDataType_System.
82  u64 timestamp; ///< POSIX timestamp.
83  u32 flags; ///< \ref FsSaveDataFlags
84  u32 unk_x54; ///< Normally 0. Possibly unused?
85  s64 data_size; ///< Usable save data size.
86  s64 journal_size; ///< Journal size of the save data.
87  u64 commit_id; ///< Id of the latest commit.
88  u8 unused[0x190]; ///< Uninitialized.
90 
91 /// SaveDataMetaInfo
92 typedef struct {
93  u32 size;
94  u8 type; ///< \ref FsSaveDataMetaType
95  u8 reserved[0x0B];
97 
98 /// SaveDataCreationInfo
99 typedef struct {
100  s64 save_data_size; ///< Size of the save data.
101  s64 journal_size; ///< Journal size of the save data.
102  u64 available_size; ///< AvailableSize
103  u64 owner_id; ///< ProgramId of the owner of this save data. 0 for ::FsSaveDataType_System.
104  u32 flags; ///< \ref FsSaveDataFlags
105  u8 save_data_space_id; ///< \ref FsSaveDataSpaceId
106  u8 unk; ///< 0 for ::FsSaveDataType_System.
107  u8 padding[0x1a]; ///< Uninitialized for ::FsSaveDataType_System.
109 
110 /// SaveDataInfo
111 typedef struct {
112  u64 save_data_id; ///< SaveDataId
113  u8 save_data_space_id; ///< \ref FsSaveDataSpaceId
114  u8 save_data_type; ///< \ref FsSaveDataType
115  u8 pad[6]; ///< Padding.
116  AccountUid uid; ///< FsSave::userID
117  u64 system_save_data_id; ///< FsSaveDataAttribute::system_save_data_id
118  u64 application_id; ///< ApplicationId for ::FsSaveDataType_Account.
119  u64 size; ///< Raw saveimage size.
120  u16 save_data_index; ///< SaveDataIndex
121  u8 save_data_rank; ///< \ref FsSaveDataRank
122  u8 unk_x3b[0x25]; ///< Unknown. Usually zeros?
124 
125 /// SaveDataFilter
126 typedef struct {
127  bool filter_by_application_id; ///< Filter by \ref FsSaveDataAttribute::application_id
128  bool filter_by_save_data_type; ///< Filter by \ref FsSaveDataAttribute::save_data_type
129  bool filter_by_user_id; ///< Filter by \ref FsSaveDataAttribute::uid
130  bool filter_by_system_save_data_id; ///< Filter by \ref FsSaveDataAttribute::system_save_data_id
131  bool filter_by_index; ///< Filter by \ref FsSaveDataAttribute::save_data_index
132  u8 save_data_rank; ///< \ref FsSaveDataRank
133  u8 padding[0x2]; ///< Padding
134  FsSaveDataAttribute attr; ///< \ref FsSaveDataAttribute
136 
137 typedef struct {
138  u64 created; ///< POSIX timestamp.
139  u64 modified; ///< POSIX timestamp.
140  u64 accessed; ///< POSIX timestamp.
141  u8 is_valid; ///< 0x1 when the timestamps are set.
142  u8 padding[7];
144 
145 /// This is nn::fssystem::ArchiveMacKey. Used by \ref setsysGetThemeKey and \ref setsysSetThemeKey. Does not appear to be in use elsewhere.
146 typedef struct {
147  u8 key[0x10];
149 
150 /// Returned by fsFsGetEntryType.
151 typedef enum {
152  FsDirEntryType_Dir = 0, ///< Entry is a directory.
153  FsDirEntryType_File = 1, ///< Entry is a file.
155 
156 /// For use with fsFsOpenFile.
157 typedef enum {
158  FsOpenMode_Read = BIT(0), ///< Open for reading.
159  FsOpenMode_Write = BIT(1), ///< Open for writing.
160  FsOpenMode_Append = BIT(2), ///< Append file.
161 } FsOpenMode;
162 
163 /// For use with fsFsCreateFile.
164 typedef enum {
165  FsCreateOption_BigFile = BIT(0), ///< Creates a ConcatenationFile (dir with archive bit) instead of file.
167 
168 /// For use with fsFsOpenDirectory.
169 typedef enum {
170  FsDirOpenMode_ReadDirs = BIT(0), ///< Enable reading directory entries.
171  FsDirOpenMode_ReadFiles = BIT(1), ///< Enable reading file entries.
172  FsDirOpenMode_NoFileSize = BIT(31), ///< Causes result entries to not contain filesize information (always 0).
173 } FsDirOpenMode;
174 
175 /// For use with fsFileRead.
176 typedef enum {
177  FsReadOption_None = 0, ///< No option.
178 } FsReadOption;
179 
180 /// For use with fsFileWrite.
181 typedef enum {
182  FsWriteOption_None = 0, ///< No option.
183  FsWriteOption_Flush = BIT(0), ///< Forces a flush after write.
184 } FsWriteOption;
185 
186 typedef enum {
187  FsContentStorageId_System = 0,
188  FsContentStorageId_User = 1,
189  FsContentStorageId_SdCard = 2,
190 } FsContentStorageId;
191 
192 typedef enum {
193  FsCustomStorageId_System = 0,
194  FsCustomStorageId_SdCard = 1,
195 } FsCustomStorageId;
196 
197 /// ImageDirectoryId
198 typedef enum {
199  FsImageDirectoryId_Nand = 0,
200  FsImageDirectoryId_Sd = 1,
202 
203 /// SaveDataSpaceId
204 typedef enum {
205  FsSaveDataSpaceId_System = 0, ///< System
206  FsSaveDataSpaceId_User = 1, ///< User
207  FsSaveDataSpaceId_SdSystem = 2, ///< SdSystem
208  FsSaveDataSpaceId_Temporary = 3, ///< [3.0.0+] Temporary
209  FsSaveDataSpaceId_SdUser = 4, ///< [4.0.0+] SdUser
210  FsSaveDataSpaceId_ProperSystem = 100, ///< [3.0.0+] ProperSystem
211  FsSaveDataSpaceId_SafeMode = 101, ///< [3.0.0+] SafeMode
212 
213  FsSaveDataSpaceId_All = -1, ///< Pseudo value for fsOpenSaveDataInfoReader().
215 
216 /// SaveDataType
217 typedef enum {
218  FsSaveDataType_System = 0, ///< System
219  FsSaveDataType_Account = 1, ///< Account
220  FsSaveDataType_Bcat = 2, ///< Bcat
221  FsSaveDataType_Device = 3, ///< Device
222  FsSaveDataType_Temporary = 4, ///< [3.0.0+] Temporary
223  FsSaveDataType_Cache = 5, ///< [3.0.0+] Cache
224  FsSaveDataType_SystemBcat = 6, ///< [4.0.0+] SystemBcat
226 
227 /// SaveDataRank
228 typedef enum {
229  FsSaveDataRank_Primary = 0, ///< Primary
230  FsSaveDataRank_Secondary = 1, ///< Secondary
232 
233 /// SaveDataFlags
234 typedef enum {
235  FsSaveDataFlags_KeepAfterResettingSystemSaveData = BIT(0),
236  FsSaveDataFlags_KeepAfterRefurbishment = BIT(1),
237  FsSaveDataFlags_KeepAfterResettingSystemSaveDataWithoutUserSaveData = BIT(2),
238  FsSaveDataFlags_NeedsSecureDelete = BIT(3),
240 
241 /// SaveDataMetaType
242 typedef enum {
243  FsSaveDataMetaType_None = 0,
244  FsSaveDataMetaType_Thumbnail = 1,
245  FsSaveDataMetaType_ExtensionContext = 2,
247 
248 typedef enum {
249  FsGameCardAttribute_AutoBootFlag = BIT(0), ///< Causes the cartridge to automatically start on bootup
250  FsGameCardAttribute_HistoryEraseFlag = BIT(1), ///< Causes NS to throw an error on attempt to load the cartridge
251  FsGameCardAttribute_RepairToolFlag = BIT(2), ///< [4.0.0+] Indicates that this gamecard is a repair tool.
252  FsGameCardAttribute_DifferentRegionCupToTerraDeviceFlag = BIT(3), ///< [9.0.0+] DifferentRegionCupToTerraDeviceFlag
253  FsGameCardAttribute_DifferentRegionCupToGlobalDeviceFlag = BIT(4), ///< [9.0.0+] DifferentRegionCupToGlobalDeviceFlag
255 
256 typedef enum {
257  FsGameCardPartition_Update = 0,
258  FsGameCardPartition_Normal = 1,
259  FsGameCardPartition_Secure = 2,
260  FsGameCardPartition_Logo = 3, ///< [4.0.0+]
262 
263 typedef struct {
264  u32 value;
266 
267 typedef struct {
268  u32 aes_ctr_key_type; ///< Contains bitflags describing how data is AES encrypted.
269  u32 speed_emulation_type; ///< Contains bitflags describing how data is emulated.
270  u32 reserved[0x38/sizeof(u32)];
271 } FsRangeInfo;
272 
273 typedef enum {
274  FsOperationId_Clear, ///< Fill range with zero for supported file/storage.
275  FsOperationId_ClearSignature, ///< Clears signature for supported file/storage.
276  FsOperationId_InvalidateCache, ///< Invalidates cache for supported file/storage.
277  FsOperationId_QueryRange, ///< Retrieves information on data for supported file/storage.
278 } FsOperationId;
279 
280 /// BisPartitionId
281 typedef enum {
282  FsBisPartitionId_BootPartition1Root = 0,
283 
284  FsBisPartitionId_BootPartition2Root = 10,
285 
286  FsBisPartitionId_UserDataRoot = 20,
287  FsBisPartitionId_BootConfigAndPackage2Part1 = 21,
288  FsBisPartitionId_BootConfigAndPackage2Part2 = 22,
289  FsBisPartitionId_BootConfigAndPackage2Part3 = 23,
290  FsBisPartitionId_BootConfigAndPackage2Part4 = 24,
291  FsBisPartitionId_BootConfigAndPackage2Part5 = 25,
292  FsBisPartitionId_BootConfigAndPackage2Part6 = 26,
293  FsBisPartitionId_CalibrationBinary = 27,
294  FsBisPartitionId_CalibrationFile = 28,
295  FsBisPartitionId_SafeMode = 29,
296  FsBisPartitionId_User = 30,
297  FsBisPartitionId_System = 31,
298  FsBisPartitionId_SystemProperEncryption = 32,
299  FsBisPartitionId_SystemProperPartition = 33,
300  FsBisPartitionId_SignedSystemPartitionOnSafeMode = 34,
302 
303 /// FileSystemType
304 typedef enum {
305  FsFileSystemType_Logo = 2, ///< Logo
306  FsFileSystemType_ContentControl = 3, ///< ContentControl
307  FsFileSystemType_ContentManual = 4, ///< ContentManual
308  FsFileSystemType_ContentMeta = 5, ///< ContentMeta
309  FsFileSystemType_ContentData = 6, ///< ContentData
310  FsFileSystemType_ApplicationPackage = 7, ///< ApplicationPackage
311  FsFileSystemType_RegisteredUpdate = 8, ///< [4.0.0+] RegisteredUpdate
313 
314 /// FileSystemQueryId
315 typedef enum {
319 
320 /// FsPriority
321 typedef enum {
322  FsPriority_Normal = 0,
323  FsPriority_Realtime = 1,
324  FsPriority_Low = 2,
325  FsPriority_Background = 3,
326 } FsPriority;
327 
328 /// For use with fsOpenHostFileSystemWithOption
329 typedef enum {
330  FsMountHostOptionFlag_None = 0, ///< Host filesystem will be case insensitive.
331  FsMountHostOptionFlag_PseudoCaseSensitive = BIT(0), ///< Host filesystem will be pseudo case sensitive.
333 
334 /// Initialize fsp-srv. Used automatically during app startup.
335 Result fsInitialize(void);
336 
337 /// Exit fsp-srv. Used automatically during app exit.
338 void fsExit(void);
339 
340 /// Gets the Service object for the actual fsp-srv service session.
342 
343 /// [5.0.0+] Configures the \ref FsPriority of all filesystem commands issued within the current thread.
344 void fsSetPriority(FsPriority prio);
345 
346 /// Mount requested filesystem type from content file
347 Result fsOpenFileSystem(FsFileSystem* out, FsFileSystemType fsType, const char* contentPath); ///< same as calling fsOpenFileSystemWithId with 0 as id
348 Result fsOpenDataFileSystemByCurrentProcess(FsFileSystem *out);
349 Result fsOpenFileSystemWithPatch(FsFileSystem* out, u64 id, FsFileSystemType fsType); ///< [2.0.0+], like OpenFileSystemWithId but without content path.
350 Result fsOpenFileSystemWithId(FsFileSystem* out, u64 id, FsFileSystemType fsType, const char* contentPath); ///< works on all firmwares, id is ignored on [1.0.0]
351 Result fsOpenDataFileSystemByProgramId(FsFileSystem *out, u64 program_id); ///< [3.0.0+]
352 Result fsOpenBisFileSystem(FsFileSystem* out, FsBisPartitionId partitionId, const char* string);
353 Result fsOpenBisStorage(FsStorage* out, FsBisPartitionId partitionId);
354 
355 /// Do not call this directly, see fs_dev.h.
357 
358 Result fsOpenHostFileSystem(FsFileSystem* out, const char *path);
359 Result fsOpenHostFileSystemWithOption(FsFileSystem* out, const char *path, u32 flags); ///< [9.0.0+]
360 
361 Result fsDeleteSaveDataFileSystem(u64 application_id);
362 Result fsCreateSaveDataFileSystem(const FsSaveDataAttribute* attr, const FsSaveDataCreationInfo* creation_info, const FsSaveDataMetaInfo* meta);
363 Result fsCreateSaveDataFileSystemBySystemSaveDataId(const FsSaveDataAttribute* attr, const FsSaveDataCreationInfo* creation_info);
364 Result fsDeleteSaveDataFileSystemBySaveDataSpaceId(FsSaveDataSpaceId save_data_space_id, u64 saveID); ///< [2.0.0+]
366 
367 Result fsIsExFatSupported(bool* out);
368 
369 Result fsOpenGameCardFileSystem(FsFileSystem* out, const FsGameCardHandle* handle, FsGameCardPartition partition);
370 
371 Result fsExtendSaveDataFileSystem(FsSaveDataSpaceId save_data_space_id, u64 saveID, s64 dataSize, s64 journalSize); ///< [3.0.0+]
372 
373 Result fsOpenSaveDataFileSystem(FsFileSystem* out, FsSaveDataSpaceId save_data_space_id, const FsSaveDataAttribute *attr);
374 Result fsOpenSaveDataFileSystemBySystemSaveDataId(FsFileSystem* out, FsSaveDataSpaceId save_data_space_id, const FsSaveDataAttribute *attr);
375 Result fsOpenReadOnlySaveDataFileSystem(FsFileSystem* out, FsSaveDataSpaceId save_data_space_id, const FsSaveDataAttribute *attr); ///< [2.0.0+].
376 
377 Result fsReadSaveDataFileSystemExtraDataBySaveDataSpaceId(void* buf, size_t len, FsSaveDataSpaceId save_data_space_id, u64 saveID);
378 Result fsReadSaveDataFileSystemExtraData(void* buf, size_t len, u64 saveID);
379 Result fsWriteSaveDataFileSystemExtraData(const void* buf, size_t len, FsSaveDataSpaceId save_data_space_id, u64 saveID);
380 
381 Result fsOpenSaveDataInfoReader(FsSaveDataInfoReader* out, FsSaveDataSpaceId save_data_space_id);
382 
383 Result fsOpenSaveDataInfoReaderWithFilter(FsSaveDataInfoReader* out, FsSaveDataSpaceId save_data_space_id, const FsSaveDataFilter *save_data_filter); ///< [6.0.0+]
384 
385 Result fsOpenImageDirectoryFileSystem(FsFileSystem* out, FsImageDirectoryId image_directory_id);
386 Result fsOpenContentStorageFileSystem(FsFileSystem* out, FsContentStorageId content_storage_id);
387 Result fsOpenCustomStorageFileSystem(FsFileSystem* out, FsCustomStorageId custom_storage_id); ///< [7.0.0+]
388 
389 Result fsOpenDataStorageByCurrentProcess(FsStorage* out);
390 Result fsOpenDataStorageByProgramId(FsStorage *out, u64 program_id); /// <[3.0.0+]
392 Result fsOpenPatchDataStorageByCurrentProcess(FsStorage* out);
393 
394 Result fsOpenDeviceOperator(FsDeviceOperator* out);
395 Result fsOpenSdCardDetectionEventNotifier(FsEventNotifier* out);
396 
397 Result fsIsSignedSystemPartitionOnSdCardValid(bool *out);
398 
399 /// Retrieves the rights id corresponding to the content path. Only available on [2.0.0+].
400 Result fsGetRightsIdByPath(const char* path, FsRightsId* out_rights_id);
401 
402 /// Retrieves the rights id and key generation corresponding to the content path. Only available on [3.0.0+].
403 Result fsGetRightsIdAndKeyGenerationByPath(const char* path, u8* out_key_generation, FsRightsId* out_rights_id);
404 
405 Result fsDisableAutoSaveDataCreation(void);
406 
407 Result fsSetGlobalAccessLogMode(u32 mode);
408 Result fsGetGlobalAccessLogMode(u32* out_mode);
409 Result fsOutputAccessLogToSdCard(const char *log, size_t size);
410 
411 /// Only available on [7.0.0+].
412 Result fsGetProgramIndexForAccessLog(u32 *out_program_index, u32 *out_program_count);
413 
414 // Wrapper(s) for fsCreateSaveDataFileSystem.
415 Result fsCreate_TemporaryStorage(u64 application_id, u64 owner_id, s64 size, u32 flags);
416 
417 // Wrapper(s) for fsCreateSaveDataFileSystemBySystemSaveDataId.
418 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);
419 Result fsCreate_SystemSaveData(FsSaveDataSpaceId save_data_space_id, u64 system_save_data_id, s64 size, s64 journal_size, u32 flags);
420 
421 /// Wrapper for fsOpenSaveDataFileSystem.
422 /// See \ref FsSaveDataAttribute for application_id and uid.
423 Result fsOpen_SaveData(FsFileSystem* out, u64 application_id, AccountUid uid);
424 
425 /// Wrapper for fsOpenReadOnlySaveDataFileSystem.
426 /// Only available on [2.0.0+].
427 /// See \ref FsSaveDataAttribute for application_id and uid.
428 Result fsOpen_SaveDataReadOnly(FsFileSystem* out, u64 application_id, AccountUid uid);
429 
430 /// Wrapper for fsOpenSaveDataFileSystem, for opening BcatSaveData.
431 Result fsOpen_BcatSaveData(FsFileSystem* out, u64 application_id);
432 
433 /// Wrapper for fsOpenSaveDataFileSystem, for opening DeviceSaveData.
434 /// See \ref FsSaveDataAttribute for application_id.
435 Result fsOpen_DeviceSaveData(FsFileSystem* out, u64 application_id);
436 
437 /// Wrapper for fsOpenSaveDataFileSystem, for opening TemporaryStorage.
438 /// Only available on [3.0.0+].
440 
441 /// Wrapper for fsOpenSaveDataFileSystem, for opening CacheStorage.
442 /// Only available on [3.0.0+].
443 /// See \ref FsSaveDataAttribute for application_id.
444 Result fsOpen_CacheStorage(FsFileSystem* out, u64 application_id, u16 save_data_index);
445 
446 /// Wrapper for fsOpenSaveDataFileSystemBySystemSaveDataId, for opening SystemSaveData.
447 /// WARNING: You can brick when writing to SystemSaveData, if the data is corrupted etc.
448 Result fsOpen_SystemSaveData(FsFileSystem* out, FsSaveDataSpaceId save_data_space_id, u64 system_save_data_id, AccountUid uid);
449 
450 /// Wrapper for fsOpenSaveDataFileSystemBySystemSaveDataId, for opening SystemBcatSaveData.
451 /// Only available on [4.0.0+].
452 Result fsOpen_SystemBcatSaveData(FsFileSystem* out, u64 system_save_data_id);
453 
454 // IFileSystem
455 Result fsFsCreateFile(FsFileSystem* fs, const char* path, s64 size, u32 option);
456 Result fsFsDeleteFile(FsFileSystem* fs, const char* path);
457 Result fsFsCreateDirectory(FsFileSystem* fs, const char* path);
458 Result fsFsDeleteDirectory(FsFileSystem* fs, const char* path);
459 Result fsFsDeleteDirectoryRecursively(FsFileSystem* fs, const char* path);
460 Result fsFsRenameFile(FsFileSystem* fs, const char* cur_path, const char* new_path);
461 Result fsFsRenameDirectory(FsFileSystem* fs, const char* cur_path, const char* new_path);
462 Result fsFsGetEntryType(FsFileSystem* fs, const char* path, FsDirEntryType* out);
463 Result fsFsOpenFile(FsFileSystem* fs, const char* path, u32 mode, FsFile* out);
464 Result fsFsOpenDirectory(FsFileSystem* fs, const char* path, u32 mode, FsDir* out);
465 Result fsFsCommit(FsFileSystem* fs);
466 Result fsFsGetFreeSpace(FsFileSystem* fs, const char* path, s64* out);
467 Result fsFsGetTotalSpace(FsFileSystem* fs, const char* path, s64* out);
468 Result fsFsGetFileTimeStampRaw(FsFileSystem* fs, const char* path, FsTimeStampRaw *out); ///< [3.0.0+]
469 Result fsFsCleanDirectoryRecursively(FsFileSystem* fs, const char* path); ///< [3.0.0+]
470 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+]
471 void fsFsClose(FsFileSystem* fs);
472 
473 /// Uses \ref fsFsQueryEntry to set the archive bit on the specified absolute directory path.
474 /// This will cause HOS to treat the directory as if it were a file containing the directory's concatenated contents.
476 
477 /// Wrapper for fsFsQueryEntry with FsFileSystemQueryId_IsValidSignedSystemPartitionOnSdCard.
478 /// Only available on [8.0.0+].
480 
481 // IFile
482 Result fsFileRead(FsFile* f, s64 off, void* buf, u64 read_size, u32 option, u64* bytes_read);
483 Result fsFileWrite(FsFile* f, s64 off, const void* buf, u64 write_size, u32 option);
484 Result fsFileFlush(FsFile* f);
485 Result fsFileSetSize(FsFile* f, s64 sz);
486 Result fsFileGetSize(FsFile* f, s64* out);
487 Result fsFileOperateRange(FsFile* f, FsOperationId op_id, s64 off, s64 len, FsRangeInfo* out); ///< [4.0.0+]
488 void fsFileClose(FsFile* f);
489 
490 // IDirectory
491 Result fsDirRead(FsDir* d, s64* total_entries, size_t max_entries, FsDirectoryEntry *buf);
492 Result fsDirGetEntryCount(FsDir* d, s64* count);
493 void fsDirClose(FsDir* d);
494 
495 // IStorage
496 Result fsStorageRead(FsStorage* s, s64 off, void* buf, u64 read_size);
497 Result fsStorageWrite(FsStorage* s, s64 off, const void* buf, u64 write_size);
498 Result fsStorageFlush(FsStorage* s);
499 Result fsStorageSetSize(FsStorage* s, s64 sz);
500 Result fsStorageGetSize(FsStorage* s, s64* out);
501 Result fsStorageOperateRange(FsStorage* s, FsOperationId op_id, s64 off, s64 len, FsRangeInfo* out); ///< [4.0.0+]
502 void fsStorageClose(FsStorage* s);
503 
504 // ISaveDataInfoReader
505 
506 /// Read FsSaveDataInfo data into the buf array.
507 Result fsSaveDataInfoReaderRead(FsSaveDataInfoReader *s, FsSaveDataInfo* buf, size_t max_entries, s64* total_entries);
508 void fsSaveDataInfoReaderClose(FsSaveDataInfoReader *s);
509 
510 // IEventNotifier
511 Result fsEventNotifierGetEventHandle(FsEventNotifier* e, Event* out, bool autoclear);
512 void fsEventNotifierClose(FsEventNotifier* e);
513 
514 // IDeviceOperator
515 Result fsDeviceOperatorIsSdCardInserted(FsDeviceOperator* d, bool* out);
516 Result fsDeviceOperatorIsGameCardInserted(FsDeviceOperator* d, bool* out);
517 Result fsDeviceOperatorGetGameCardHandle(FsDeviceOperator* d, FsGameCardHandle* out);
518 Result fsDeviceOperatorGetGameCardAttribute(FsDeviceOperator* d, const FsGameCardHandle* handle, u8 *out);
519 void fsDeviceOperatorClose(FsDeviceOperator* d);
FsSaveDataRank_Secondary
@ FsSaveDataRank_Secondary
Secondary.
Definition: fs.h:230
FsSaveDataSpaceId_User
@ FsSaveDataSpaceId_User
User.
Definition: fs.h:206
s64
int64_t s64
64-bit signed integer.
Definition: types.h:28
fsOpenSaveDataInfoReaderWithFilter
Result fsOpenSaveDataInfoReaderWithFilter(FsSaveDataInfoReader *out, FsSaveDataSpaceId save_data_space_id, const FsSaveDataFilter *save_data_filter)
[6.0.0+]
FsTimeStampRaw::created
u64 created
POSIX timestamp.
Definition: fs.h:138
FsSaveDataSpaceId_SafeMode
@ FsSaveDataSpaceId_SafeMode
[3.0.0+] SafeMode
Definition: fs.h:211
FsArchiveMacKey
This is nn::fssystem::ArchiveMacKey. Used by setsysGetThemeKey and setsysSetThemeKey....
Definition: fs.h:146
FsFileSystemQueryId_IsValidSignedSystemPartitionOnSdCard
@ FsFileSystemQueryId_IsValidSignedSystemPartitionOnSdCard
[8.0.0+]
Definition: fs.h:317
FsSaveDataSpaceId_SdSystem
@ FsSaveDataSpaceId_SdSystem
SdSystem.
Definition: fs.h:207
FsRightsId
Definition: fs.h:23
FsGameCardPartition
FsGameCardPartition
Definition: fs.h:256
FsSaveDataAttribute::unk_x38
u64 unk_x38
0 for FsSaveDataType_System/FsSaveDataType_Account.
Definition: fs.h:75
FsFileSystemType_RegisteredUpdate
@ FsFileSystemType_RegisteredUpdate
[4.0.0+] RegisteredUpdate
Definition: fs.h:311
FsSaveDataInfo::system_save_data_id
u64 system_save_data_id
FsSaveDataAttribute::system_save_data_id.
Definition: fs.h:117
fsSaveDataInfoReaderRead
Result fsSaveDataInfoReaderRead(FsSaveDataInfoReader *s, FsSaveDataInfo *buf, size_t max_entries, s64 *total_entries)
Read FsSaveDataInfo data into the buf array.
FsFile
Definition: fs.h:31
NcmStorageId
NcmStorageId
StorageId.
Definition: ncm_types.h:12
fsOpen_TemporaryStorage
Result fsOpen_TemporaryStorage(FsFileSystem *out)
Wrapper for fsOpenSaveDataFileSystem, for opening TemporaryStorage.
FsSaveDataAttribute::unk_x30
u64 unk_x30
0 for FsSaveDataType_System/FsSaveDataType_Account.
Definition: fs.h:74
fsOpenHostFileSystemWithOption
Result fsOpenHostFileSystemWithOption(FsFileSystem *out, const char *path, u32 flags)
[9.0.0+]
FsMountHostOptionFlag_None
@ FsMountHostOptionFlag_None
Host filesystem will be case insensitive.
Definition: fs.h:330
FsDirEntryType
FsDirEntryType
Returned by fsFsGetEntryType.
Definition: fs.h:151
FsSaveDataAttribute::unk_x28
u64 unk_x28
0 for FsSaveDataType_System/FsSaveDataType_Account.
Definition: fs.h:73
fsFsCleanDirectoryRecursively
Result fsFsCleanDirectoryRecursively(FsFileSystem *fs, const char *path)
[3.0.0+]
FsSaveDataType_Bcat
@ FsSaveDataType_Bcat
Bcat.
Definition: fs.h:220
FsSaveDataExtraData::flags
u32 flags
FsSaveDataFlags
Definition: fs.h:83
FsSaveDataFilter::filter_by_save_data_type
bool filter_by_save_data_type
Filter by FsSaveDataAttribute::save_data_type.
Definition: fs.h:128
FsSaveDataInfo::save_data_type
u8 save_data_type
FsSaveDataType
Definition: fs.h:114
FsSaveDataAttribute
SaveDataAttribute.
Definition: fs.h:65
FsOperationId_ClearSignature
@ FsOperationId_ClearSignature
Clears signature for supported file/storage.
Definition: fs.h:275
u8
uint8_t u8
8-bit unsigned integer.
Definition: types.h:19
FsDirectoryEntry::type
s8 type
See FsDirEntryType.
Definition: fs.h:59
fsOpenSdCardFileSystem
Result fsOpenSdCardFileSystem(FsFileSystem *out)
Do not call this directly, see fs_dev.h.
FsOperationId_InvalidateCache
@ FsOperationId_InvalidateCache
Invalidates cache for supported file/storage.
Definition: fs.h:276
Event
Kernel-mode event structure.
Definition: event.h:13
FsSaveDataInfoReader
Definition: fs.h:43
FsSaveDataSpaceId_System
@ FsSaveDataSpaceId_System
System.
Definition: fs.h:205
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.
FsSaveDataCreationInfo::save_data_space_id
u8 save_data_space_id
FsSaveDataSpaceId
Definition: fs.h:105
FsFileSystemType_ApplicationPackage
@ FsFileSystemType_ApplicationPackage
ApplicationPackage.
Definition: fs.h:310
fsFileOperateRange
Result fsFileOperateRange(FsFile *f, FsOperationId op_id, s64 off, s64 len, FsRangeInfo *out)
[4.0.0+]
FsSaveDataFlags
FsSaveDataFlags
SaveDataFlags.
Definition: fs.h:234
FsSaveDataSpaceId_SdUser
@ FsSaveDataSpaceId_SdUser
[4.0.0+] SdUser
Definition: fs.h:209
FsSaveDataInfo::uid
AccountUid uid
FsSave::userID.
Definition: fs.h:116
FsTimeStampRaw
Definition: fs.h:137
FsSaveDataFilter
SaveDataFilter.
Definition: fs.h:126
FsGameCardAttribute_HistoryEraseFlag
@ FsGameCardAttribute_HistoryEraseFlag
Causes NS to throw an error on attempt to load the cartridge.
Definition: fs.h:250
fsSetPriority
void fsSetPriority(FsPriority prio)
[5.0.0+] Configures the FsPriority of all filesystem commands issued within the current thread.
AccountUid
Account UserId.
Definition: acc.h:25
FsMountHostOptionFlag_PseudoCaseSensitive
@ FsMountHostOptionFlag_PseudoCaseSensitive
Host filesystem will be pseudo case sensitive.
Definition: fs.h:331
fsOpenFileSystemWithPatch
Result fsOpenFileSystemWithPatch(FsFileSystem *out, u64 id, FsFileSystemType fsType)
[2.0.0+], like OpenFileSystemWithId but without content path.
FsSaveDataSpaceId_Temporary
@ FsSaveDataSpaceId_Temporary
[3.0.0+] Temporary
Definition: fs.h:208
fsOpen_CacheStorage
Result fsOpen_CacheStorage(FsFileSystem *out, u64 application_id, u16 save_data_index)
Wrapper for fsOpenSaveDataFileSystem, for opening CacheStorage.
FsSaveDataInfo::save_data_index
u16 save_data_index
SaveDataIndex.
Definition: fs.h:120
FsOpenMode
FsOpenMode
For use with fsFsOpenFile.
Definition: fs.h:157
FsFileSystemType
FsFileSystemType
FileSystemType.
Definition: fs.h:304
FsSaveDataExtraData::data_size
s64 data_size
Usable save data size.
Definition: fs.h:85
FsRangeInfo
Definition: fs.h:267
FsSaveDataInfo::save_data_id
u64 save_data_id
SaveDataId.
Definition: fs.h:112
FsSaveDataCreationInfo::available_size
u64 available_size
AvailableSize.
Definition: fs.h:102
FsSaveDataCreationInfo::save_data_size
s64 save_data_size
Size of the save data.
Definition: fs.h:100
fsOpenCustomStorageFileSystem
Result fsOpenCustomStorageFileSystem(FsFileSystem *out, FsCustomStorageId custom_storage_id)
[7.0.0+]
FsDirOpenMode_ReadFiles
@ FsDirOpenMode_ReadFiles
Enable reading file entries.
Definition: fs.h:171
fsOpen_BcatSaveData
Result fsOpen_BcatSaveData(FsFileSystem *out, u64 application_id)
Wrapper for fsOpenSaveDataFileSystem, for opening BcatSaveData.
FsSaveDataCreationInfo
SaveDataCreationInfo.
Definition: fs.h:99
FsSaveDataCreationInfo::journal_size
s64 journal_size
Journal size of the save data.
Definition: fs.h:101
fsInitialize
Result fsInitialize(void)
Initialize fsp-srv. Used automatically during app startup.
FsSaveDataType_Cache
@ FsSaveDataType_Cache
[3.0.0+] Cache
Definition: fs.h:223
FsEventNotifier
Definition: fs.h:47
FsOpenMode_Write
@ FsOpenMode_Write
Open for writing.
Definition: fs.h:159
FsSaveDataSpaceId
FsSaveDataSpaceId
SaveDataSpaceId.
Definition: fs.h:204
FsCreateOption_BigFile
@ FsCreateOption_BigFile
Creates a ConcatenationFile (dir with archive bit) instead of file.
Definition: fs.h:165
FsOperationId_QueryRange
@ FsOperationId_QueryRange
Retrieves information on data for supported file/storage.
Definition: fs.h:277
FsReadOption
FsReadOption
For use with fsFileRead.
Definition: fs.h:176
FsSaveDataMetaInfo
SaveDataMetaInfo.
Definition: fs.h:92
fsOpenFileSystemWithId
Result fsOpenFileSystemWithId(FsFileSystem *out, u64 id, FsFileSystemType fsType, const char *contentPath)
works on all firmwares, id is ignored on [1.0.0]
FsTimeStampRaw::is_valid
u8 is_valid
0x1 when the timestamps are set.
Definition: fs.h:141
FsSaveDataExtraData::journal_size
s64 journal_size
Journal size of the save data.
Definition: fs.h:86
FsReadOption_None
@ FsReadOption_None
No option.
Definition: fs.h:177
FsSaveDataAttribute::pad_x24
u32 pad_x24
Padding.
Definition: fs.h:72
u32
uint32_t u32
32-bit unsigned integer.
Definition: types.h:21
FsSaveDataInfo
SaveDataInfo.
Definition: fs.h:111
FsGameCardHandle
Definition: fs.h:263
FsSaveDataCreationInfo::unk
u8 unk
0 for FsSaveDataType_System.
Definition: fs.h:106
FsFileSystemQueryId
FsFileSystemQueryId
FileSystemQueryId.
Definition: fs.h:315
fsOpen_SystemBcatSaveData
Result fsOpen_SystemBcatSaveData(FsFileSystem *out, u64 system_save_data_id)
Wrapper for fsOpenSaveDataFileSystemBySystemSaveDataId, for opening SystemBcatSaveData.
FsSaveDataExtraData::commit_id
u64 commit_id
Id of the latest commit.
Definition: fs.h:87
FsStorage
Definition: fs.h:39
s8
int8_t s8
8-bit signed integer.
Definition: types.h:25
FsGameCardAttribute_AutoBootFlag
@ FsGameCardAttribute_AutoBootFlag
Causes the cartridge to automatically start on bootup.
Definition: fs.h:249
fsOpenReadOnlySaveDataFileSystem
Result fsOpenReadOnlySaveDataFileSystem(FsFileSystem *out, FsSaveDataSpaceId save_data_space_id, const FsSaveDataAttribute *attr)
[2.0.0+].
FsFileSystemType_ContentMeta
@ FsFileSystemType_ContentMeta
ContentMeta.
Definition: fs.h:308
fsOpen_SaveDataReadOnly
Result fsOpen_SaveDataReadOnly(FsFileSystem *out, u64 application_id, AccountUid uid)
Wrapper for fsOpenReadOnlySaveDataFileSystem.
FsSaveDataInfo::save_data_space_id
u8 save_data_space_id
FsSaveDataSpaceId
Definition: fs.h:113
FsSaveDataAttribute::system_save_data_id
u64 system_save_data_id
SystemSaveDataId, 0 for FsSaveDataType_Account.
Definition: fs.h:68
u64
uint64_t u64
64-bit unsigned integer.
Definition: types.h:22
fsGetRightsIdAndKeyGenerationByPath
Result fsGetRightsIdAndKeyGenerationByPath(const char *path, u8 *out_key_generation, FsRightsId *out_rights_id)
Retrieves the rights id and key generation corresponding to the content path. Only available on [3....
FsOpenMode_Read
@ FsOpenMode_Read
Open for reading.
Definition: fs.h:158
FsGameCardAttribute_DifferentRegionCupToTerraDeviceFlag
@ FsGameCardAttribute_DifferentRegionCupToTerraDeviceFlag
[9.0.0+] DifferentRegionCupToTerraDeviceFlag
Definition: fs.h:252
fsOpen_DeviceSaveData
Result fsOpen_DeviceSaveData(FsFileSystem *out, u64 application_id)
Wrapper for fsOpenSaveDataFileSystem, for opening DeviceSaveData.
FsSaveDataType_System
@ FsSaveDataType_System
System.
Definition: fs.h:218
FsGameCardAttribute
FsGameCardAttribute
Definition: fs.h:248
FsDirEntryType_File
@ FsDirEntryType_File
Entry is a file.
Definition: fs.h:153
FsSaveDataRank
FsSaveDataRank
SaveDataRank.
Definition: fs.h:228
FsSaveDataAttribute::save_data_type
u8 save_data_type
FsSaveDataType
Definition: fs.h:69
Result
u32 Result
Function error code result type.
Definition: types.h:44
FsFileSystemQueryId_SetConcatenationFileAttribute
@ FsFileSystemQueryId_SetConcatenationFileAttribute
[4.0.0+]
Definition: fs.h:316
FsWriteOption_Flush
@ FsWriteOption_Flush
Forces a flush after write.
Definition: fs.h:183
FsDirEntryType_Dir
@ FsDirEntryType_Dir
Entry is a directory.
Definition: fs.h:152
FsSaveDataInfo::size
u64 size
Raw saveimage size.
Definition: fs.h:119
FsSaveDataExtraData::owner_id
u64 owner_id
ProgramId of the owner of this save data. 0 for FsSaveDataType_System.
Definition: fs.h:81
FsOperationId
FsOperationId
Definition: fs.h:273
FsDirOpenMode
FsDirOpenMode
For use with fsFsOpenDirectory.
Definition: fs.h:169
fsOpenFileSystem
Result fsOpenFileSystem(FsFileSystem *out, FsFileSystemType fsType, const char *contentPath)
Mount requested filesystem type from content file.
FsTimeStampRaw::accessed
u64 accessed
POSIX timestamp.
Definition: fs.h:140
FsSaveDataCreationInfo::owner_id
u64 owner_id
ProgramId of the owner of this save data. 0 for FsSaveDataType_System.
Definition: fs.h:103
FsPriority
FsPriority
FsPriority.
Definition: fs.h:321
FsSaveDataAttribute::save_data_rank
u8 save_data_rank
FsSaveDataRank
Definition: fs.h:70
FsSaveDataMetaInfo::type
u8 type
FsSaveDataMetaType
Definition: fs.h:94
FsDirectoryEntry
Directory entry.
Definition: fs.h:56
fsDeleteSaveDataFileSystemBySaveDataSpaceId
Result fsDeleteSaveDataFileSystemBySaveDataSpaceId(FsSaveDataSpaceId save_data_space_id, u64 saveID)
[2.0.0+]
FsDirOpenMode_ReadDirs
@ FsDirOpenMode_ReadDirs
Enable reading directory entries.
Definition: fs.h:170
FsFileSystemType_ContentManual
@ FsFileSystemType_ContentManual
ContentManual.
Definition: fs.h:307
FsMountHostOption
FsMountHostOption
For use with fsOpenHostFileSystemWithOption.
Definition: fs.h:329
FsDir
Definition: fs.h:35
fsStorageOperateRange
Result fsStorageOperateRange(FsStorage *s, FsOperationId op_id, s64 off, s64 len, FsRangeInfo *out)
[4.0.0+]
FsTimeStampRaw::modified
u64 modified
POSIX timestamp.
Definition: fs.h:139
FsRangeInfo::speed_emulation_type
u32 speed_emulation_type
Contains bitflags describing how data is emulated.
Definition: fs.h:269
fsDeleteSaveDataFileSystemBySaveDataAttribute
Result fsDeleteSaveDataFileSystemBySaveDataAttribute(FsSaveDataSpaceId save_data_space_id, const FsSaveDataAttribute *attr)
[4.0.0+]
FsFileSystemType_ContentData
@ FsFileSystemType_ContentData
ContentData.
Definition: fs.h:309
fsFsGetFileTimeStampRaw
Result fsFsGetFileTimeStampRaw(FsFileSystem *fs, const char *path, FsTimeStampRaw *out)
[3.0.0+]
FsSaveDataMetaType
FsSaveDataMetaType
SaveDataMetaType.
Definition: fs.h:242
FsGameCardPartition_Logo
@ FsGameCardPartition_Logo
[4.0.0+]
Definition: fs.h:260
FsDirectoryEntry::file_size
s64 file_size
File size.
Definition: fs.h:61
FsWriteOption_None
@ FsWriteOption_None
No option.
Definition: fs.h:182
FsDeviceOperator
Definition: fs.h:51
fsExit
void fsExit(void)
Exit fsp-srv. Used automatically during app exit.
FsSaveDataType_Device
@ FsSaveDataType_Device
Device.
Definition: fs.h:221
fsOpen_SaveData
Result fsOpen_SaveData(FsFileSystem *out, u64 application_id, AccountUid uid)
Wrapper for fsOpenSaveDataFileSystem.
fsGetProgramIndexForAccessLog
Result fsGetProgramIndexForAccessLog(u32 *out_program_index, u32 *out_program_count)
Only available on [7.0.0+].
fsOpenDataStorageByDataId
Result fsOpenDataStorageByDataId(FsStorage *out, u64 dataId, NcmStorageId storageId)
<[3.0.0+]
FsSaveDataFilter::filter_by_system_save_data_id
bool filter_by_system_save_data_id
Filter by FsSaveDataAttribute::system_save_data_id.
Definition: fs.h:130
fsFsQueryEntry
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+]
FsSaveDataAttribute::save_data_index
u16 save_data_index
SaveDataIndex.
Definition: fs.h:71
fsExtendSaveDataFileSystem
Result fsExtendSaveDataFileSystem(FsSaveDataSpaceId save_data_space_id, u64 saveID, s64 dataSize, s64 journalSize)
[3.0.0+]
FsFileSystemType_ContentControl
@ FsFileSystemType_ContentControl
ContentControl.
Definition: fs.h:306
fsFsSetConcatenationFileAttribute
Result fsFsSetConcatenationFileAttribute(FsFileSystem *fs, const char *path)
Uses fsFsQueryEntry to set the archive bit on the specified absolute directory path.
FsSaveDataFilter::attr
FsSaveDataAttribute attr
FsSaveDataAttribute
Definition: fs.h:134
FsOpenMode_Append
@ FsOpenMode_Append
Append file.
Definition: fs.h:160
FsSaveDataType_Account
@ FsSaveDataType_Account
Account.
Definition: fs.h:219
FsFileSystem
Definition: fs.h:27
FsSaveDataType_Temporary
@ FsSaveDataType_Temporary
[3.0.0+] Temporary
Definition: fs.h:222
FsSaveDataType_SystemBcat
@ FsSaveDataType_SystemBcat
[4.0.0+] SystemBcat
Definition: fs.h:224
FsDirOpenMode_NoFileSize
@ FsDirOpenMode_NoFileSize
Causes result entries to not contain filesize information (always 0).
Definition: fs.h:172
FsGameCardAttribute_RepairToolFlag
@ FsGameCardAttribute_RepairToolFlag
[4.0.0+] Indicates that this gamecard is a repair tool.
Definition: fs.h:251
FsSaveDataCreationInfo::flags
u32 flags
FsSaveDataFlags
Definition: fs.h:104
BIT
#define BIT(n)
Creates a bitmask from a bit number.
Definition: types.h:54
Service
Service object structure.
Definition: service.h:13
FsSaveDataInfo::application_id
u64 application_id
ApplicationId for FsSaveDataType_Account.
Definition: fs.h:118
FsImageDirectoryId
FsImageDirectoryId
ImageDirectoryId.
Definition: fs.h:198
fsFsIsValidSignedSystemPartitionOnSdCard
Result fsFsIsValidSignedSystemPartitionOnSdCard(FsFileSystem *fs, bool *out)
Wrapper for fsFsQueryEntry with FsFileSystemQueryId_IsValidSignedSystemPartitionOnSdCard.
FsSaveDataExtraData
SaveDataExtraData.
Definition: fs.h:79
FsSaveDataFilter::filter_by_index
bool filter_by_index
Filter by FsSaveDataAttribute::save_data_index.
Definition: fs.h:131
FsSaveDataFilter::save_data_rank
u8 save_data_rank
FsSaveDataRank
Definition: fs.h:132
FsFileSystemType_Logo
@ FsFileSystemType_Logo
Logo.
Definition: fs.h:305
FsSaveDataExtraData::attr
FsSaveDataAttribute attr
FsSaveDataAttribute
Definition: fs.h:80
FsSaveDataSpaceId_All
@ FsSaveDataSpaceId_All
Pseudo value for fsOpenSaveDataInfoReader().
Definition: fs.h:213
FsSaveDataAttribute::uid
AccountUid uid
AccountUid for the user-specific savedata to access, otherwise 0 for common savedata.
Definition: fs.h:67
FsGameCardAttribute_DifferentRegionCupToGlobalDeviceFlag
@ FsGameCardAttribute_DifferentRegionCupToGlobalDeviceFlag
[9.0.0+] DifferentRegionCupToGlobalDeviceFlag
Definition: fs.h:253
FsSaveDataInfo::save_data_rank
u8 save_data_rank
FsSaveDataRank
Definition: fs.h:121
fsGetRightsIdByPath
Result fsGetRightsIdByPath(const char *path, FsRightsId *out_rights_id)
Retrieves the rights id corresponding to the content path. Only available on [2.0....
fsGetServiceSession
Service * fsGetServiceSession(void)
Gets the Service object for the actual fsp-srv service session.
FsSaveDataAttribute::application_id
u64 application_id
ApplicationId of the savedata to access when accessing other programs' savedata via SaveData,...
Definition: fs.h:66
FsSaveDataFilter::filter_by_application_id
bool filter_by_application_id
Filter by FsSaveDataAttribute::application_id.
Definition: fs.h:127
FsSaveDataExtraData::unk_x54
u32 unk_x54
Normally 0. Possibly unused?
Definition: fs.h:84
FsSaveDataRank_Primary
@ FsSaveDataRank_Primary
Primary.
Definition: fs.h:229
FsSaveDataExtraData::timestamp
u64 timestamp
POSIX timestamp.
Definition: fs.h:82
FsSaveDataFilter::filter_by_user_id
bool filter_by_user_id
Filter by FsSaveDataAttribute::uid.
Definition: fs.h:129
FsSaveDataType
FsSaveDataType
SaveDataType.
Definition: fs.h:217
FsOperationId_Clear
@ FsOperationId_Clear
Fill range with zero for supported file/storage.
Definition: fs.h:274
u16
uint16_t u16
16-bit unsigned integer.
Definition: types.h:20
FsBisPartitionId
FsBisPartitionId
BisPartitionId.
Definition: fs.h:281
FsWriteOption
FsWriteOption
For use with fsFileWrite.
Definition: fs.h:181
fsOpenDataFileSystemByProgramId
Result fsOpenDataFileSystemByProgramId(FsFileSystem *out, u64 program_id)
[3.0.0+]
FsSaveDataSpaceId_ProperSystem
@ FsSaveDataSpaceId_ProperSystem
[3.0.0+] ProperSystem
Definition: fs.h:210
FsCreateOption
FsCreateOption
For use with fsFsCreateFile.
Definition: fs.h:164
FsRangeInfo::aes_ctr_key_type
u32 aes_ctr_key_type
Contains bitflags describing how data is AES encrypted.
Definition: fs.h:268