mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 12:32:40 +02:00
fs: add fsOpenHostFileSystem(WithOption)
This commit is contained in:
parent
0f4f0ed039
commit
ae3271ba4c
@ -313,6 +313,12 @@ typedef enum {
|
||||
FsPriority_Background = 3,
|
||||
} FsPriority;
|
||||
|
||||
/// For use with fsOpenHostFileSystemWithOption
|
||||
typedef enum {
|
||||
FsMountHostOptionFlag_None = 0, ///< Host filesystem will be case insensitive.
|
||||
FsMountHostOptionFlag_PseudoCaseSensitive = BIT(0), ///< Host filesystem will be pseudo case sensitive.
|
||||
} FsMountHostOption;
|
||||
|
||||
/// Initialize fsp-srv. Used automatically during app startup.
|
||||
Result fsInitialize(void);
|
||||
|
||||
@ -337,6 +343,9 @@ Result fsOpenBisStorage(FsStorage* out, FsBisPartitionId partitionId);
|
||||
/// Do not call this directly, see fs_dev.h.
|
||||
Result fsOpenSdCardFileSystem(FsFileSystem* out);
|
||||
|
||||
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);
|
||||
|
@ -224,6 +224,33 @@ Result fsOpenSdCardFileSystem(FsFileSystem* out) {
|
||||
return _fsCmdGetSession(&g_fsSrv, &out->s, 18);
|
||||
}
|
||||
|
||||
Result fsOpenHostFileSystem(FsFileSystem* out, const char *path) {
|
||||
char tmpstr[FS_MAX_PATH] = {0};
|
||||
strncpy(tmpstr, path, sizeof(tmpstr)-1);
|
||||
|
||||
return _fsObjectDispatch(&g_fsSrv, 17,
|
||||
.buffer_attrs = { SfBufferAttr_HipcPointer | SfBufferAttr_In },
|
||||
.buffers = { { tmpstr, sizeof(tmpstr) } },
|
||||
.out_num_objects = 1,
|
||||
.out_objects = &out->s,
|
||||
);
|
||||
}
|
||||
|
||||
Result fsOpenHostFileSystemWithOption(FsFileSystem* out, const char *path, u32 flags) {
|
||||
if (hosversionBefore(9,0,0))
|
||||
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
||||
|
||||
char tmpstr[FS_MAX_PATH] = {0};
|
||||
strncpy(tmpstr, path, sizeof(tmpstr)-1);
|
||||
|
||||
return _fsObjectDispatchIn(&g_fsSrv, 36, flags,
|
||||
.buffer_attrs = { SfBufferAttr_HipcPointer | SfBufferAttr_In },
|
||||
.buffers = { { tmpstr, sizeof(tmpstr) } },
|
||||
.out_num_objects = 1,
|
||||
.out_objects = &out->s,
|
||||
);
|
||||
}
|
||||
|
||||
Result fsDeleteSaveDataFileSystem(u64 application_id) {
|
||||
return _fsObjectDispatchIn(&g_fsSrv, 21, application_id);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user