libnx  v4.2.2
Data Structures | Macros | Functions
fs_dev.h File Reference

FS driver, using devoptab. More...

#include <sys/types.h>
#include "../../services/fs.h"

Go to the source code of this file.

Data Structures

struct  fsdev_dir_t
 Open directory struct. More...
 

Macros

#define FSDEV_DIRITER_MAGIC   0x66736476
 "fsdv"
 

Functions

static FsDirectoryEntryfsdevDirGetEntries (fsdev_dir_t *dir)
 Retrieves a pointer to temporary stage for reading entries.
 
Result fsdevMountSdmc (void)
 Initializes and mounts the sdmc device if accessible.
 
Result fsdevMountSaveData (const char *name, u64 application_id, AccountUid uid)
 Mounts the specified SaveData.
 
Result fsdevMountSaveDataReadOnly (const char *name, u64 application_id, AccountUid uid)
 Mounts the specified SaveData as ReadOnly. More...
 
Result fsdevMountBcatSaveData (const char *name, u64 application_id)
 Mounts the specified BcatSaveData.
 
Result fsdevMountDeviceSaveData (const char *name, u64 application_id)
 Mounts the specified DeviceSaveData.
 
Result fsdevMountTemporaryStorage (const char *name)
 Mounts the TemporaryStorage for the current process. More...
 
Result fsdevMountCacheStorage (const char *name, u64 application_id, u16 save_data_index)
 Mounts the specified CacheStorage. More...
 
Result fsdevMountSystemSaveData (const char *name, FsSaveDataSpaceId save_data_space_id, u64 system_save_data_id, AccountUid uid)
 Mounts the specified SystemSaveData.
 
Result fsdevMountSystemBcatSaveData (const char *name, u64 system_save_data_id)
 Mounts the specified SystemBcatSaveData. More...
 
int fsdevMountDevice (const char *name, FsFileSystem fs)
 Mounts the input fs with the specified device name. More...
 
int fsdevUnmountDevice (const char *name)
 Unmounts the specified device.
 
Result fsdevCommitDevice (const char *name)
 Uses fsFsCommit() with the specified device. More...
 
FsFileSystemfsdevGetDeviceFileSystem (const char *name)
 Returns the FsFileSystem for the specified device. Returns NULL when the specified device isn't found.
 
int fsdevTranslatePath (const char *path, FsFileSystem **device, char *outpath)
 Writes the FS-path to outpath (which has buffer size FS_MAX_PATH), for the input path (as used in stdio). The FsFileSystem is also written to device when not NULL.
 
Result fsdevSetConcatenationFileAttribute (const char *path)
 This calls fsFsSetConcatenationFileAttribute on the filesystem specified by the input path (as used in stdio).
 
Result fsdevIsValidSignedSystemPartitionOnSdCard (const char *name, bool *out)
 
Result fsdevCreateFile (const char *path, size_t size, u32 flags)
 This calls fsFsCreateFile on the filesystem specified by the input path (as used in stdio).
 
Result fsdevDeleteDirectoryRecursively (const char *path)
 Recursively deletes the directory specified by the input path (as used in stdio).
 
Result fsdevUnmountAll (void)
 Unmounts all devices and cleans up any resources used by the FS driver.
 
Result fsdevGetLastResult (void)
 Retrieves the last native result code generated during a failed fsdev operation.
 

Detailed Description

FS driver, using devoptab.

Author
yellows8
mtheall

Function Documentation

◆ fsdevCommitDevice()

Result fsdevCommitDevice ( const char *  name)

Uses fsFsCommit() with the specified device.

This must be used after any savedata-write operations(not just file-write). This should be used after each file-close where file-writing was done. This is not used automatically at device unmount.

◆ fsdevMountCacheStorage()

Result fsdevMountCacheStorage ( const char *  name,
u64  application_id,
u16  save_data_index 
)

Mounts the specified CacheStorage.

Only available on [3.0.0+].

◆ fsdevMountDevice()

int fsdevMountDevice ( const char *  name,
FsFileSystem  fs 
)

Mounts the input fs with the specified device name.

fsdev will handle closing the fs when required, including when fsdevMountDevice() fails. Returns -1 when any errors occur. Input device name string shouldn't exceed 31 characters, and shouldn't have a trailing colon.

◆ fsdevMountSaveDataReadOnly()

Result fsdevMountSaveDataReadOnly ( const char *  name,
u64  application_id,
AccountUid  uid 
)

Mounts the specified SaveData as ReadOnly.

Only available on [2.0.0+].

◆ fsdevMountSystemBcatSaveData()

Result fsdevMountSystemBcatSaveData ( const char *  name,
u64  system_save_data_id 
)

Mounts the specified SystemBcatSaveData.

Only available on [4.0.0+].

◆ fsdevMountTemporaryStorage()

Result fsdevMountTemporaryStorage ( const char *  name)

Mounts the TemporaryStorage for the current process.

Only available on [3.0.0+].