libnx
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

Result fsdevMountSdmc (void)
 Initializes and mounts the sdmc device if accessible. Also initializes current working directory to point to the folder containing the path to the executable (argv[0]), if it is provided by the environment.
 
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...
 
FsFileSystemfsdevGetDefaultFileSystem (void)
 Returns the FsFileSystem for the default device (SD card), if mounted. Used internally by romfs_dev.
 
Result fsdevUnmountAll (void)
 Unmounts all devices and cleans up any resources used by the FS driver.
 

Detailed Description

FS driver, using devoptab.

Author
yellows8
mtheall

Function Documentation

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 is not used automatically at device unmount.

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.