wut  v1.7.0
Wii U Toolchain
Data Structures | Macros | Typedefs | Enumerations | Functions
Filesystem

Mount, access and modify filesystems directly. More...

Collaboration diagram for Filesystem:

Data Structures

struct  FSFsm
 
struct  FSCmdQueue
 
struct  FSMessage
 
struct  FSClientBody
 
struct  FSClient
 
struct  FSCmdBlock
 
struct  FSStat
 
struct  FSStateChangeParams
 
struct  FSAsyncData
 
struct  FSAsyncResult
 Stores the result of an async FS command. More...
 
struct  FSCmdBlockBody
 
struct  FSDirectoryEntry
 
struct  FSMountSource
 
struct  FSVolumeInfo
 

Macros

#define FS_MAX_PATH   (0x27F)
 
#define FS_MODE_LENGTH   (0x10)
 

Typedefs

typedef uint32_t FSDirectoryHandle
 
typedef uint32_t FSFileHandle
 
typedef uint32_t FSPriority
 
typedef uint64_t FSTime
 
typedef struct FSFsm FSFsm
 
typedef struct FSCmdQueue FSCmdQueue
 
typedef struct FSClientBodyLink FSClientBodyLink
 
typedef struct FSAsyncData FSAsyncData
 
typedef struct FSAsyncResult FSAsyncResult
 
typedef struct FSClientBody FSClientBody
 
typedef struct FSClient FSClient
 
typedef struct FSCmdBlockBody FSCmdBlockBody
 
typedef struct FSCmdBlock FSCmdBlock
 
typedef struct FSDirectoryEntry FSDirectoryEntry
 
typedef struct FSMessage FSMessage
 
typedef struct FSMountSource FSMountSource
 
typedef struct FSStat FSStat
 
typedef struct FSStateChangeParams FSStateChangeParams
 
typedef struct FSStateChangeParams FSStateChangeInfo
 
typedef struct FSVolumeInfo FSVolumeInfo
 
typedef enum FSErrorFlag FSErrorFlag
 
typedef enum FSStatus FSStatus
 
typedef enum FSError FSError
 
typedef enum FSMode FSMode
 
typedef enum FSStatFlags FSStatFlags
 Flags for FSStat. More...
 
typedef enum FSVolumeState FSVolumeState
 
typedef enum FSMediaState FSMediaState
 
typedef enum FSMountSourceType FSMountSourceType
 
typedef enum FSOpenFileFlags FSOpenFileFlags
 
typedef void(* FSAsyncCallback) (FSClient *, FSCmdBlock *, FSStatus, uint32_t)
 
typedef void(* FSStateChangeCallback) (FSClient *, FSVolumeState, void *)
 

Enumerations

enum  FSErrorFlag {
  FS_ERROR_FLAG_NONE = 0x0 ,
  FS_ERROR_FLAG_MAX = 0x1 ,
  FS_ERROR_FLAG_ALREADY_OPEN = 0x2 ,
  FS_ERROR_FLAG_EXISTS = 0x4 ,
  FS_ERROR_FLAG_NOT_FOUND = 0x8 ,
  FS_ERROR_FLAG_NOT_FILE = 0x10 ,
  FS_ERROR_FLAG_NOT_DIR = 0x20 ,
  FS_ERROR_FLAG_ACCESS_ERROR = 0x40 ,
  FS_ERROR_FLAG_PERMISSION_ERROR = 0x80 ,
  FS_ERROR_FLAG_FILE_TOO_BIG = 0x100 ,
  FS_ERROR_FLAG_STORAGE_FULL = 0x200 ,
  FS_ERROR_FLAG_UNSUPPORTED_CMD = 0x400 ,
  FS_ERROR_FLAG_JOURNAL_FULL = 0x800 ,
  FS_ERROR_FLAG_ALL = 0xFFFFFFFF
}
 
enum  FSStatus {
  FS_STATUS_OK = 0 ,
  FS_STATUS_CANCELLED = -1 ,
  FS_STATUS_END = -2 ,
  FS_STATUS_MAX = -3 ,
  FS_STATUS_ALREADY_OPEN = -4 ,
  FS_STATUS_EXISTS = -5 ,
  FS_STATUS_NOT_FOUND = -6 ,
  FS_STATUS_NOT_FILE = -7 ,
  FS_STATUS_NOT_DIR = -8 ,
  FS_STATUS_ACCESS_ERROR = -9 ,
  FS_STATUS_PERMISSION_ERROR = -10 ,
  FS_STATUS_FILE_TOO_BIG = -11 ,
  FS_STATUS_STORAGE_FULL = -12 ,
  FS_STATUS_JOURNAL_FULL = -13 ,
  FS_STATUS_UNSUPPORTED_CMD = -14 ,
  FS_STATUS_MEDIA_NOT_READY = -15 ,
  FS_STATUS_MEDIA_ERROR = -17 ,
  FS_STATUS_CORRUPTED = -18 ,
  FS_STATUS_FATAL_ERROR = -0x400
}
 
enum  FSError {
  FS_ERROR_OK = 0 ,
  FS_ERROR_NOT_INIT = -0x30001 ,
  FS_ERROR_BUSY = -0x30002 ,
  FS_ERROR_CANCELLED = -0x30003 ,
  FS_ERROR_END_OF_DIR = -0x30004 ,
  FS_ERROR_END_OF_FILE = -0x30005 ,
  FS_ERROR_MAX_MOUNT_POINTS = -0x30010 ,
  FS_ERROR_MAX_VOLUMES = -0x30011 ,
  FS_ERROR_MAX_CLIENTS = -0x30012 ,
  FS_ERROR_MAX_FILES = -0x30013 ,
  FS_ERROR_MAX_DIRS = -0x30014 ,
  FS_ERROR_ALREADY_OPEN = -0x30015 ,
  FS_ERROR_ALREADY_EXISTS = -0x30016 ,
  FS_ERROR_NOT_FOUND = -0x30017 ,
  FS_ERROR_NOT_EMPTY = -0x30018 ,
  FS_ERROR_ACCESS_ERROR = -0x30019 ,
  FS_ERROR_PERMISSION_ERROR = -0x3001A ,
  FS_ERROR_DATA_CORRUPTED = -0x3001B ,
  FS_ERROR_STORAGE_FULL = -0x3001C ,
  FS_ERROR_JOURNAL_FULL = -0x3001D ,
  FS_ERROR_UNAVAILABLE_COMMAND = -0x3001F ,
  FS_ERROR_UNSUPPORTED_COMMAND = -0x30020 ,
  FS_ERROR_INVALID_PARAM = -0x30021 ,
  FS_ERROR_INVALID_PATH = -0x30022 ,
  FS_ERROR_INVALID_BUFFER = -0x30023 ,
  FS_ERROR_INVALID_ALIGNMENT = -0x30024 ,
  FS_ERROR_INVALID_CLIENTHANDLE = -0x30025 ,
  FS_ERROR_INVALID_FILEHANDLE = -0x30026 ,
  FS_ERROR_INVALID_DIRHANDLE = -0x30027 ,
  FS_ERROR_NOT_FILE = -0x30028 ,
  FS_ERROR_NOT_DIR = -0x30029 ,
  FS_ERROR_FILE_TOO_BIG = -0x3002A ,
  FS_ERROR_OUT_OF_RANGE = -0x3002B ,
  FS_ERROR_OUT_OF_RESOURCES = -0x3002C ,
  FS_ERROR_MEDIA_NOT_READY = -0x30040 ,
  FS_ERROR_MEDIA_ERROR = -0x30041 ,
  FS_ERROR_WRITE_PROTECTED = -0x30042 ,
  FS_ERROR_INVALID_MEDIA = -0x30043
}
 
enum  FSMode {
  FS_MODE_READ_OWNER = 0x400 ,
  FS_MODE_WRITE_OWNER = 0x200 ,
  FS_MODE_EXEC_OWNER = 0x100 ,
  FS_MODE_READ_GROUP = 0x040 ,
  FS_MODE_WRITE_GROUP = 0x020 ,
  FS_MODE_EXEC_GROUP = 0x010 ,
  FS_MODE_READ_OTHER = 0x004 ,
  FS_MODE_WRITE_OTHER = 0x002 ,
  FS_MODE_EXEC_OTHER = 0x001
}
 
enum  FSStatFlags {
  FS_STAT_DIRECTORY = 0x80000000 ,
  FS_STAT_QUOTA = 0x60000000 ,
  FS_STAT_FILE = 0x01000000 ,
  FS_STAT_ENCRYPTED_FILE = 0x00800000 ,
  FS_STAT_LINK = 0x00010000
}
 Flags for FSStat. More...
 
enum  FSVolumeState {
  FS_VOLUME_STATE_INITIAL = 0 ,
  FS_VOLUME_STATE_READY = 1 ,
  FS_VOLUME_STATE_NO_MEDIA = 2 ,
  FS_VOLUME_STATE_INVALID_MEDIA = 3 ,
  FS_VOLUME_STATE_DIRTY_MEDIA = 4 ,
  FS_VOLUME_STATE_WRONG_MEDIA = 5 ,
  FS_VOLUME_STATE_MEDIA_ERROR = 6 ,
  FS_VOLUME_STATE_DATA_CORRUPTED = 7 ,
  FS_VOLUME_STATE_WRITE_PROTECTED = 8 ,
  FS_VOLUME_STATE_JOURNAL_FULL = 9 ,
  FS_VOLUME_STATE_FATAL = 10 ,
  FS_VOLUME_STATE_INVALID = 11
}
 
enum  FSMediaState {
  FS_MEDIA_STATE_READY = 0 ,
  FS_MEDIA_STATE_NO_MEDIA = 1 ,
  FS_MEDIA_STATE_INVALID_MEDIA = 2 ,
  FS_MEDIA_STATE_DIRTY_MEDIA = 3 ,
  FS_MEDIA_STATE_MEDIA_ERROR = 4
}
 
enum  FSMountSourceType {
  FS_MOUNT_SOURCE_SD = 0 ,
  FS_MOUNT_SOURCE_UNK = 1
}
 
enum  FSOpenFileFlags {
  FS_OPEN_FLAG_NONE = (0 << 0) ,
  FS_OPEN_FLAG_UNENCRYPTED = (1 << 0) ,
  FS_OPEN_FLAG_PREALLOC_SIZE = (1 << 1)
}
 

Functions

static FSClientBodyFSGetClientBody (FSClient *client)
 Get an aligned FSClientBody from an FSClient. More...
 
static FSCmdBlockBodyFSGetCmdBlockBody (FSCmdBlock *cmdBlock)
 Get an aligned FSCmdBlockBody from an FSCmdBlock. More...
 
void FSInit ()
 
void FSShutdown ()
 
FSStatus FSAddClient (FSClient *client, FSErrorFlag errorMask)
 
FSStatus FSDelClient (FSClient *client, FSErrorFlag errorMask)
 
uint32_t FSGetClientNum ()
 
void FSInitCmdBlock (FSCmdBlock *block)
 
FSStatus FSSetCmdPriority (FSCmdBlock *block, FSPriority priority)
 
void FSSetStateChangeNotification (FSClient *client, FSStateChangeParams *info)
 
FSStatus FSGetCwd (FSClient *client, FSCmdBlock *block, char *buffer, uint32_t bufferSize, FSErrorFlag errorMask)
 
FSStatus FSChangeDir (FSClient *client, FSCmdBlock *block, const char *path, FSErrorFlag errorMask)
 
FSStatus FSChangeDirAsync (FSClient *client, FSCmdBlock *block, const char *path, FSErrorFlag errorMask, FSAsyncData *asyncData)
 
FSAsyncResultFSGetAsyncResult (FSMessage *message)
 
FSStatus FSGetStat (FSClient *client, FSCmdBlock *block, const char *path, FSStat *stat, FSErrorFlag errorMask)
 
FSStatus FSGetStatAsync (FSClient *client, FSCmdBlock *block, const char *path, FSStat *stat, FSErrorFlag errorMask, FSAsyncData *asyncData)
 
FSStatus FSRemove (FSClient *client, FSCmdBlock *block, const char *path, FSErrorFlag errorMask)
 
FSStatus FSRemoveAsync (FSClient *client, FSCmdBlock *block, const char *path, FSErrorFlag errorMask, FSAsyncData *asyncData)
 
FSStatus FSOpenFile (FSClient *client, FSCmdBlock *block, const char *path, const char *mode, FSFileHandle *handle, FSErrorFlag errorMask)
 
FSStatus FSOpenFileAsync (FSClient *client, FSCmdBlock *block, const char *path, const char *mode, FSFileHandle *outHandle, FSErrorFlag errorMask, FSAsyncData *asyncData)
 
FSStatus FSCloseFile (FSClient *client, FSCmdBlock *block, FSFileHandle handle, FSErrorFlag errorMask)
 
FSStatus FSCloseFileAsync (FSClient *client, FSCmdBlock *block, FSFileHandle handle, FSErrorFlag errorMask, FSAsyncData *asyncData)
 
FSStatus FSOpenFileEx (FSClient *client, FSCmdBlock *block, const char *path, const char *mode, FSMode createMode, FSOpenFileFlags openFlag, uint32_t preallocSize, FSFileHandle *handle, FSErrorFlag errorMask)
 
FSStatus FSOpenFileExAsync (FSClient *client, FSCmdBlock *block, const char *path, const char *mode, FSMode createMode, FSOpenFileFlags openFlag, uint32_t preallocSize, FSFileHandle *handle, FSErrorFlag errorMask, FSAsyncData *asyncData)
 
FSStatus FSOpenDir (FSClient *client, FSCmdBlock *block, const char *path, FSDirectoryHandle *handle, FSErrorFlag errorMask)
 
FSStatus FSOpenDirAsync (FSClient *client, FSCmdBlock *block, const char *path, FSDirectoryHandle *handle, FSErrorFlag errorMask, FSAsyncData *asyncData)
 
FSStatus FSMakeDir (FSClient *client, FSCmdBlock *block, const char *path, FSErrorFlag errorMask)
 
FSStatus FSMakeDirAsync (FSClient *client, FSCmdBlock *block, const char *path, FSErrorFlag errorMask, FSAsyncData *asyncData)
 
FSStatus FSReadDir (FSClient *client, FSCmdBlock *block, FSDirectoryHandle handle, FSDirectoryEntry *entry, FSErrorFlag errorMask)
 
FSStatus FSReadDirAsync (FSClient *client, FSCmdBlock *block, FSDirectoryHandle handle, FSDirectoryEntry *entry, FSErrorFlag errorMask, FSAsyncData *asyncData)
 
FSStatus FSRewindDir (FSClient *client, FSCmdBlock *block, FSDirectoryHandle handle, FSErrorFlag errorMask)
 
FSStatus FSCloseDir (FSClient *client, FSCmdBlock *block, FSDirectoryHandle handle, FSErrorFlag errorMask)
 
FSStatus FSGetVolumeInfo (FSClient *client, FSCmdBlock *block, const char *path, FSVolumeInfo *volumeInfo, FSErrorFlag errorMask)
 
FSStatus FSGetVolumeInfoAsync (FSClient *client, FSCmdBlock *block, const char *path, FSVolumeInfo *volumeInfo, FSErrorFlag errorMask, FSAsyncData *asyncData)
 
FSStatus FSCloseDirAsync (FSClient *client, FSCmdBlock *block, FSDirectoryHandle handle, FSErrorFlag errorMask, FSAsyncData *asyncData)
 
FSStatus FSChangeMode (FSClient *client, FSCmdBlock *block, const char *path, FSMode mode, FSMode modeMask, FSErrorFlag errorMask)
 
FSStatus FSChangeModeAsync (FSClient *client, FSCmdBlock *block, const char *path, FSMode mode, FSMode modeMask, FSErrorFlag errorMask, FSAsyncData *asyncData)
 
FSStatus FSGetFreeSpaceSize (FSClient *client, FSCmdBlock *block, const char *path, uint64_t *outSize, FSErrorFlag errorMask)
 
FSStatus FSGetFreeSpaceSizeAsync (FSClient *client, FSCmdBlock *block, const char *path, uint64_t *outSize, FSErrorFlag errorMask, FSAsyncData *asyncData)
 
FSStatus FSGetStatFile (FSClient *client, FSCmdBlock *block, FSFileHandle handle, FSStat *stat, FSErrorFlag errorMask)
 
FSStatus FSGetStatFileAsync (FSClient *client, FSCmdBlock *block, FSFileHandle handle, FSStat *stat, FSErrorFlag errorMask, FSAsyncData *asyncData)
 
FSStatus FSReadFile (FSClient *client, FSCmdBlock *block, uint8_t *buffer, uint32_t size, uint32_t count, FSFileHandle handle, uint32_t unk1, FSErrorFlag errorMask)
 
FSStatus FSReadFileAsync (FSClient *client, FSCmdBlock *block, uint8_t *buffer, uint32_t size, uint32_t count, FSFileHandle handle, uint32_t unk1, FSErrorFlag errorMask, FSAsyncData *asyncData)
 
FSStatus FSReadFileWithPos (FSClient *client, FSCmdBlock *block, uint8_t *buffer, uint32_t size, uint32_t count, uint32_t pos, FSFileHandle handle, uint32_t unk1, FSErrorFlag errorMask)
 
FSStatus FSReadFileWithPosAsync (FSClient *client, FSCmdBlock *block, uint8_t *buffer, uint32_t size, uint32_t count, uint32_t pos, FSFileHandle handle, uint32_t unk1, FSErrorFlag errorMask, FSAsyncData *asyncData)
 
FSStatus FSWriteFile (FSClient *client, FSCmdBlock *block, uint8_t *buffer, uint32_t size, uint32_t count, FSFileHandle handle, uint32_t unk1, FSErrorFlag errorMask)
 
FSStatus FSWriteFileAsync (FSClient *client, FSCmdBlock *block, uint8_t *buffer, uint32_t size, uint32_t count, FSFileHandle handle, uint32_t unk1, FSErrorFlag errorMask, FSAsyncData *asyncData)
 
FSStatus FSWriteFileWithPos (FSClient *client, FSCmdBlock *block, uint8_t *buffer, uint32_t size, uint32_t count, uint32_t pos, FSFileHandle handle, uint32_t unk1, FSErrorFlag errorMask)
 
FSStatus FSWriteFileWithPosAsync (FSClient *client, FSCmdBlock *block, uint8_t *buffer, uint32_t size, uint32_t count, uint32_t pos, FSFileHandle handle, uint32_t unk1, FSErrorFlag errorMask, FSAsyncData *asyncData)
 
FSStatus FSGetPosFile (FSClient *client, FSCmdBlock *block, FSFileHandle fileHandle, uint32_t *pos, FSErrorFlag errorMask)
 
FSStatus FSGetPosFileAsync (FSClient *client, FSCmdBlock *block, FSFileHandle fileHandle, uint32_t *pos, FSErrorFlag errorMask, FSAsyncData *asyncData)
 
FSStatus FSSetPosFile (FSClient *client, FSCmdBlock *block, FSFileHandle handle, uint32_t pos, FSErrorFlag errorMask)
 
FSStatus FSSetPosFileAsync (FSClient *client, FSCmdBlock *block, FSFileHandle handle, uint32_t pos, FSErrorFlag errorMask, FSAsyncData *asyncData)
 
FSStatus FSFlushFile (FSClient *client, FSCmdBlock *block, FSFileHandle handle, FSErrorFlag errorMask)
 
FSStatus FSFlushFileAsync (FSClient *client, FSCmdBlock *block, FSFileHandle handle, FSErrorFlag errorMask, FSAsyncData *asyncData)
 
FSStatus FSTruncateFile (FSClient *client, FSCmdBlock *block, FSFileHandle handle, FSErrorFlag errorMask)
 
FSStatus FSTruncateFileAsync (FSClient *client, FSCmdBlock *block, FSFileHandle handle, FSErrorFlag errorMask, FSAsyncData *asyncData)
 
FSStatus FSRename (FSClient *client, FSCmdBlock *block, const char *oldPath, const char *newPath, FSErrorFlag errorMask)
 
FSStatus FSRenameAsync (FSClient *client, FSCmdBlock *block, const char *oldPath, const char *newPath, FSErrorFlag errorMask, FSAsyncData *asyncData)
 
FSVolumeState FSGetVolumeState (FSClient *client)
 
FSError FSGetLastError (FSClient *client)
 
FSError FSGetLastErrorCodeForViewer (FSClient *client)
 
FSStatus FSGetMountSource (FSClient *client, FSCmdBlock *cmd, FSMountSourceType type, FSMountSource *out, FSErrorFlag errorMask)
 
FSStatus FSMount (FSClient *client, FSCmdBlock *cmd, FSMountSource *source, const char *target, uint32_t bytes, FSErrorFlag errorMask)
 
FSStatus FSUnmount (FSClient *client, FSCmdBlock *cmd, const char *target, FSErrorFlag errorMask)
 
FSStatus FSBindMount (FSClient *client, FSCmdBlock *cmd, const char *source, const char *target, FSErrorFlag errorMask)
 
FSStatus FSBindUnmount (FSClient *client, FSCmdBlock *cmd, const char *target, FSErrorFlag errorMask)
 
void FSTimeToCalendarTime (FSTime time, OSCalendarTime *outCalendarTime)
 File times aren't always available in which case it returns the default 1980-01-01. More...
 

Detailed Description

Mount, access and modify filesystems directly.

First call FSInit to initialise the file system library, then call FSAddClient to initialise your FSClient structure, then you need to use FSInitCmdBlock to initialise an FSCmdBlock structure for each command you want to run in parallel. You must ensure the previous filesystem command has been completed before reusing the same FSCmdBlock, you do not need to reinitialise an FSCmdBlock before reusing it.


Data Structure Documentation

◆ FSFsm

struct FSFsm

Definition at line 210 of file filesystem.h.

◆ FSCmdQueue

struct FSCmdQueue

Definition at line 216 of file filesystem.h.

◆ FSMessage

struct FSMessage

Definition at line 222 of file filesystem.h.

Data Fields
void * data Message data.
OSFunctionType type Type of message.

◆ FSClientBodyLink

struct FSClientBodyLink

Link entry used for FSClientBodyQueue.

Definition at line 239 of file filesystem.h.

Data Fields
FSClientBody * next
FSClientBody * prev

◆ FSClientBody

struct FSClientBody

Definition at line 248 of file filesystem.h.

Data Fields
IOSHandle clientHandle IOSHandle returned from fsaShimOpen.
FSFsm fsm State machine.
FSCmdQueue cmdQueue Command queue of FS commands.
FSCmdBlockBody * lastDequeuedCommand The last dequeued command.
FSError emulatedError Emulated error, set with FSSetEmulatedError.
OSFastMutex mutex Mutex used to protect FSClientBody data.
OSAlarm fsmAlarm Alarm used by fsm for unknown reasons.
FSError lastError Error of last FS command.
bool isLastErrorWithoutVolume
FSMessage fsCmdHandlerMsg Message used to send FsCmdHandler message when FSA async callback is received.
char lastMountSourceDevice[0x10] Device name of the last mount source returned by FSGetMountSourceNext.
FSMountSourceType findMountSourceType Mount source type to find with FSGetMountSourceNext.
FSClientBodyLink link Link used for linked list of clients.
FSClient * client Pointer to unaligned FSClient structure.

◆ FSClient

struct FSClient

Definition at line 313 of file filesystem.h.

◆ FSCmdBlock

struct FSCmdBlock

Definition at line 319 of file filesystem.h.

◆ FSStat

struct FSStat

Definition at line 325 of file filesystem.h.

Data Fields
FSStatFlags flags
FSMode mode
uint32_t owner
uint32_t group
uint32_t size
uint32_t allocSize
uint64_t quotaSize
uint32_t entryId
FSTime created
FSTime modified

◆ FSStateChangeParams

struct FSStateChangeParams

Definition at line 351 of file filesystem.h.

Data Fields
FSStateChangeCallback callback
void * param
OSMessageQueue * ioMsgQueue

◆ FSAsyncData

struct FSAsyncData

Definition at line 362 of file filesystem.h.

Data Fields
FSAsyncCallback callback
uint32_t param
OSMessageQueue * ioMsgQueue

◆ FSAsyncResult

struct FSAsyncResult

Stores the result of an async FS command.

Definition at line 376 of file filesystem.h.

Data Fields
FSAsyncData asyncData User supplied async data.
FSMessage ioMsg Message to put into asyncdata.ioMsgQueue.
FSClient * client FSClient which owns this result.
FSCmdBlock * block FSCmdBlock which owns this result.
FSStatus status The result of the command.

◆ FSCmdBlockBody

struct FSCmdBlockBody

Definition at line 400 of file filesystem.h.

Data Fields
FSAsyncResult asyncResult

◆ FSDirectoryEntry

struct FSDirectoryEntry

Definition at line 408 of file filesystem.h.

Data Fields
FSStat info
char name[256]

◆ FSMountSource

struct FSMountSource

Definition at line 416 of file filesystem.h.

◆ FSVolumeInfo

struct FSVolumeInfo

Definition at line 422 of file filesystem.h.

Data Fields
uint32_t flags
FSMediaState mediaState
uint32_t unk0x0C
uint32_t unk0x10
int32_t unk0x14
int32_t unk0x18
char volumeLabel[128]
char volumeId[128]
char devicePath[16]
char mountPath[128]

Macro Definition Documentation

◆ FS_MAX_PATH

#define FS_MAX_PATH   (0x27F)

Definition at line 28 of file filesystem.h.

◆ FS_MODE_LENGTH

#define FS_MODE_LENGTH   (0x10)

Definition at line 29 of file filesystem.h.

Typedef Documentation

◆ FSDirectoryHandle

typedef uint32_t FSDirectoryHandle

Definition at line 31 of file filesystem.h.

◆ FSFileHandle

typedef uint32_t FSFileHandle

Definition at line 32 of file filesystem.h.

◆ FSPriority

typedef uint32_t FSPriority

Definition at line 33 of file filesystem.h.

◆ FSTime

typedef uint64_t FSTime

Definition at line 34 of file filesystem.h.

◆ FSFsm

typedef struct FSFsm FSFsm

Definition at line 34 of file filesystem.h.

◆ FSCmdQueue

typedef struct FSCmdQueue FSCmdQueue

Definition at line 34 of file filesystem.h.

◆ FSClientBodyLink

Definition at line 34 of file filesystem.h.

◆ FSAsyncData

typedef struct FSAsyncData FSAsyncData

Definition at line 34 of file filesystem.h.

◆ FSAsyncResult

typedef struct FSAsyncResult FSAsyncResult

Definition at line 34 of file filesystem.h.

◆ FSClientBody

typedef struct FSClientBody FSClientBody

Definition at line 34 of file filesystem.h.

◆ FSClient

typedef struct FSClient FSClient

Definition at line 34 of file filesystem.h.

◆ FSCmdBlockBody

Definition at line 34 of file filesystem.h.

◆ FSCmdBlock

typedef struct FSCmdBlock FSCmdBlock

Definition at line 34 of file filesystem.h.

◆ FSDirectoryEntry

Definition at line 34 of file filesystem.h.

◆ FSMessage

typedef struct FSMessage FSMessage

Definition at line 34 of file filesystem.h.

◆ FSMountSource

typedef struct FSMountSource FSMountSource

Definition at line 34 of file filesystem.h.

◆ FSStat

typedef struct FSStat FSStat

Definition at line 34 of file filesystem.h.

◆ FSStateChangeParams

Definition at line 34 of file filesystem.h.

◆ FSStateChangeInfo

Definition at line 34 of file filesystem.h.

◆ FSVolumeInfo

typedef struct FSVolumeInfo FSVolumeInfo

Definition at line 34 of file filesystem.h.

◆ FSErrorFlag

typedef enum FSErrorFlag FSErrorFlag

◆ FSStatus

typedef enum FSStatus FSStatus

◆ FSError

typedef enum FSError FSError

◆ FSMode

typedef enum FSMode FSMode

◆ FSStatFlags

typedef enum FSStatFlags FSStatFlags

Flags for FSStat.

One can return multiple flags, so for example a file that's encrypted or a linked directory.

◆ FSVolumeState

◆ FSMediaState

typedef enum FSMediaState FSMediaState

◆ FSMountSourceType

◆ FSOpenFileFlags

◆ FSAsyncCallback

typedef void(* FSAsyncCallback) (FSClient *, FSCmdBlock *, FSStatus, uint32_t)

Definition at line 207 of file filesystem.h.

◆ FSStateChangeCallback

typedef void(* FSStateChangeCallback) (FSClient *, FSVolumeState, void *)

Definition at line 208 of file filesystem.h.

Enumeration Type Documentation

◆ FSErrorFlag

Enumerator
FS_ERROR_FLAG_NONE 
FS_ERROR_FLAG_MAX 
FS_ERROR_FLAG_ALREADY_OPEN 
FS_ERROR_FLAG_EXISTS 
FS_ERROR_FLAG_NOT_FOUND 
FS_ERROR_FLAG_NOT_FILE 
FS_ERROR_FLAG_NOT_DIR 
FS_ERROR_FLAG_ACCESS_ERROR 
FS_ERROR_FLAG_PERMISSION_ERROR 
FS_ERROR_FLAG_FILE_TOO_BIG 
FS_ERROR_FLAG_STORAGE_FULL 
FS_ERROR_FLAG_UNSUPPORTED_CMD 
FS_ERROR_FLAG_JOURNAL_FULL 
FS_ERROR_FLAG_ALL 

Definition at line 53 of file filesystem.h.

◆ FSStatus

enum FSStatus
Enumerator
FS_STATUS_OK 
FS_STATUS_CANCELLED 
FS_STATUS_END 
FS_STATUS_MAX 
FS_STATUS_ALREADY_OPEN 
FS_STATUS_EXISTS 
FS_STATUS_NOT_FOUND 
FS_STATUS_NOT_FILE 
FS_STATUS_NOT_DIR 
FS_STATUS_ACCESS_ERROR 
FS_STATUS_PERMISSION_ERROR 
FS_STATUS_FILE_TOO_BIG 
FS_STATUS_STORAGE_FULL 
FS_STATUS_JOURNAL_FULL 
FS_STATUS_UNSUPPORTED_CMD 
FS_STATUS_MEDIA_NOT_READY 
FS_STATUS_MEDIA_ERROR 
FS_STATUS_CORRUPTED 
FS_STATUS_FATAL_ERROR 

Definition at line 71 of file filesystem.h.

◆ FSError

enum FSError
Enumerator
FS_ERROR_OK 
FS_ERROR_NOT_INIT 
FS_ERROR_BUSY 
FS_ERROR_CANCELLED 
FS_ERROR_END_OF_DIR 
FS_ERROR_END_OF_FILE 
FS_ERROR_MAX_MOUNT_POINTS 
FS_ERROR_MAX_VOLUMES 
FS_ERROR_MAX_CLIENTS 
FS_ERROR_MAX_FILES 
FS_ERROR_MAX_DIRS 
FS_ERROR_ALREADY_OPEN 
FS_ERROR_ALREADY_EXISTS 
FS_ERROR_NOT_FOUND 
FS_ERROR_NOT_EMPTY 
FS_ERROR_ACCESS_ERROR 
FS_ERROR_PERMISSION_ERROR 
FS_ERROR_DATA_CORRUPTED 
FS_ERROR_STORAGE_FULL 
FS_ERROR_JOURNAL_FULL 
FS_ERROR_UNAVAILABLE_COMMAND 
FS_ERROR_UNSUPPORTED_COMMAND 
FS_ERROR_INVALID_PARAM 
FS_ERROR_INVALID_PATH 
FS_ERROR_INVALID_BUFFER 
FS_ERROR_INVALID_ALIGNMENT 
FS_ERROR_INVALID_CLIENTHANDLE 
FS_ERROR_INVALID_FILEHANDLE 
FS_ERROR_INVALID_DIRHANDLE 
FS_ERROR_NOT_FILE 
FS_ERROR_NOT_DIR 
FS_ERROR_FILE_TOO_BIG 
FS_ERROR_OUT_OF_RANGE 
FS_ERROR_OUT_OF_RESOURCES 
FS_ERROR_MEDIA_NOT_READY 
FS_ERROR_MEDIA_ERROR 
FS_ERROR_WRITE_PROTECTED 
FS_ERROR_INVALID_MEDIA 

Definition at line 94 of file filesystem.h.

◆ FSMode

enum FSMode
Enumerator
FS_MODE_READ_OWNER 
FS_MODE_WRITE_OWNER 
FS_MODE_EXEC_OWNER 
FS_MODE_READ_GROUP 
FS_MODE_WRITE_GROUP 
FS_MODE_EXEC_GROUP 
FS_MODE_READ_OTHER 
FS_MODE_WRITE_OTHER 
FS_MODE_EXEC_OTHER 

Definition at line 136 of file filesystem.h.

◆ FSStatFlags

Flags for FSStat.

One can return multiple flags, so for example a file that's encrypted or a linked directory.

Enumerator
FS_STAT_DIRECTORY 

The retrieved file entry is a (link to a) directory.

FS_STAT_QUOTA 

The retrieved file entry also has a quota set.

FS_STAT_FILE 

The retrieved file entry is a (link to a) file.

FS_STAT_ENCRYPTED_FILE 

The retrieved file entry also is encrypted and can't be opened (see vWii files for example).

FS_STAT_LINK 

The retrieved file entry also is a link to a different file on the filesystem.

Note: It's currently not known how one can read the linked-to file entry.

Definition at line 153 of file filesystem.h.

◆ FSVolumeState

Enumerator
FS_VOLUME_STATE_INITIAL 
FS_VOLUME_STATE_READY 
FS_VOLUME_STATE_NO_MEDIA 
FS_VOLUME_STATE_INVALID_MEDIA 
FS_VOLUME_STATE_DIRTY_MEDIA 
FS_VOLUME_STATE_WRONG_MEDIA 
FS_VOLUME_STATE_MEDIA_ERROR 
FS_VOLUME_STATE_DATA_CORRUPTED 
FS_VOLUME_STATE_WRITE_PROTECTED 
FS_VOLUME_STATE_JOURNAL_FULL 
FS_VOLUME_STATE_FATAL 
FS_VOLUME_STATE_INVALID 

Definition at line 168 of file filesystem.h.

◆ FSMediaState

Enumerator
FS_MEDIA_STATE_READY 
FS_MEDIA_STATE_NO_MEDIA 
FS_MEDIA_STATE_INVALID_MEDIA 
FS_MEDIA_STATE_DIRTY_MEDIA 
FS_MEDIA_STATE_MEDIA_ERROR 

Definition at line 184 of file filesystem.h.

◆ FSMountSourceType

Enumerator
FS_MOUNT_SOURCE_SD 
FS_MOUNT_SOURCE_UNK 

Definition at line 192 of file filesystem.h.

◆ FSOpenFileFlags

Enumerator
FS_OPEN_FLAG_NONE 

Open file normally.

FS_OPEN_FLAG_UNENCRYPTED 

Open (new) unencrypted file. Used for vWii files since it allows for direct access without the Wii U filesystem through it's block address.

FS_OPEN_FLAG_PREALLOC_SIZE 

Preallocates new file size using given size.

Definition at line 197 of file filesystem.h.

Function Documentation

◆ FSGetClientBody()

static FSClientBody* FSGetClientBody ( FSClient client)
inlinestatic

Get an aligned FSClientBody from an FSClient.

Definition at line 453 of file filesystem.h.

◆ FSGetCmdBlockBody()

static FSCmdBlockBody* FSGetCmdBlockBody ( FSCmdBlock cmdBlock)
inlinestatic

Get an aligned FSCmdBlockBody from an FSCmdBlock.

Definition at line 464 of file filesystem.h.

◆ FSInit()

void FSInit ( )

◆ FSShutdown()

void FSShutdown ( )

◆ FSAddClient()

FSStatus FSAddClient ( FSClient client,
FSErrorFlag  errorMask 
)

◆ FSDelClient()

FSStatus FSDelClient ( FSClient client,
FSErrorFlag  errorMask 
)

◆ FSGetClientNum()

uint32_t FSGetClientNum ( )

◆ FSInitCmdBlock()

void FSInitCmdBlock ( FSCmdBlock block)

◆ FSSetCmdPriority()

FSStatus FSSetCmdPriority ( FSCmdBlock block,
FSPriority  priority 
)

◆ FSSetStateChangeNotification()

void FSSetStateChangeNotification ( FSClient client,
FSStateChangeParams info 
)

◆ FSGetCwd()

FSStatus FSGetCwd ( FSClient client,
FSCmdBlock block,
char *  buffer,
uint32_t  bufferSize,
FSErrorFlag  errorMask 
)

◆ FSChangeDir()

FSStatus FSChangeDir ( FSClient client,
FSCmdBlock block,
const char *  path,
FSErrorFlag  errorMask 
)

◆ FSChangeDirAsync()

FSStatus FSChangeDirAsync ( FSClient client,
FSCmdBlock block,
const char *  path,
FSErrorFlag  errorMask,
FSAsyncData asyncData 
)

◆ FSGetAsyncResult()

FSAsyncResult* FSGetAsyncResult ( FSMessage message)

◆ FSGetStat()

FSStatus FSGetStat ( FSClient client,
FSCmdBlock block,
const char *  path,
FSStat stat,
FSErrorFlag  errorMask 
)

◆ FSGetStatAsync()

FSStatus FSGetStatAsync ( FSClient client,
FSCmdBlock block,
const char *  path,
FSStat stat,
FSErrorFlag  errorMask,
FSAsyncData asyncData 
)

◆ FSRemove()

FSStatus FSRemove ( FSClient client,
FSCmdBlock block,
const char *  path,
FSErrorFlag  errorMask 
)

◆ FSRemoveAsync()

FSStatus FSRemoveAsync ( FSClient client,
FSCmdBlock block,
const char *  path,
FSErrorFlag  errorMask,
FSAsyncData asyncData 
)

◆ FSOpenFile()

FSStatus FSOpenFile ( FSClient client,
FSCmdBlock block,
const char *  path,
const char *  mode,
FSFileHandle handle,
FSErrorFlag  errorMask 
)

◆ FSOpenFileAsync()

FSStatus FSOpenFileAsync ( FSClient client,
FSCmdBlock block,
const char *  path,
const char *  mode,
FSFileHandle outHandle,
FSErrorFlag  errorMask,
FSAsyncData asyncData 
)

◆ FSCloseFile()

FSStatus FSCloseFile ( FSClient client,
FSCmdBlock block,
FSFileHandle  handle,
FSErrorFlag  errorMask 
)

◆ FSCloseFileAsync()

FSStatus FSCloseFileAsync ( FSClient client,
FSCmdBlock block,
FSFileHandle  handle,
FSErrorFlag  errorMask,
FSAsyncData asyncData 
)

◆ FSOpenFileEx()

FSStatus FSOpenFileEx ( FSClient client,
FSCmdBlock block,
const char *  path,
const char *  mode,
FSMode  createMode,
FSOpenFileFlags  openFlag,
uint32_t  preallocSize,
FSFileHandle handle,
FSErrorFlag  errorMask 
)

◆ FSOpenFileExAsync()

FSStatus FSOpenFileExAsync ( FSClient client,
FSCmdBlock block,
const char *  path,
const char *  mode,
FSMode  createMode,
FSOpenFileFlags  openFlag,
uint32_t  preallocSize,
FSFileHandle handle,
FSErrorFlag  errorMask,
FSAsyncData asyncData 
)

◆ FSOpenDir()

FSStatus FSOpenDir ( FSClient client,
FSCmdBlock block,
const char *  path,
FSDirectoryHandle handle,
FSErrorFlag  errorMask 
)

◆ FSOpenDirAsync()

FSStatus FSOpenDirAsync ( FSClient client,
FSCmdBlock block,
const char *  path,
FSDirectoryHandle handle,
FSErrorFlag  errorMask,
FSAsyncData asyncData 
)

◆ FSMakeDir()

FSStatus FSMakeDir ( FSClient client,
FSCmdBlock block,
const char *  path,
FSErrorFlag  errorMask 
)

◆ FSMakeDirAsync()

FSStatus FSMakeDirAsync ( FSClient client,
FSCmdBlock block,
const char *  path,
FSErrorFlag  errorMask,
FSAsyncData asyncData 
)

◆ FSReadDir()

FSStatus FSReadDir ( FSClient client,
FSCmdBlock block,
FSDirectoryHandle  handle,
FSDirectoryEntry entry,
FSErrorFlag  errorMask 
)

◆ FSReadDirAsync()

FSStatus FSReadDirAsync ( FSClient client,
FSCmdBlock block,
FSDirectoryHandle  handle,
FSDirectoryEntry entry,
FSErrorFlag  errorMask,
FSAsyncData asyncData 
)

◆ FSRewindDir()

FSStatus FSRewindDir ( FSClient client,
FSCmdBlock block,
FSDirectoryHandle  handle,
FSErrorFlag  errorMask 
)

◆ FSCloseDir()

FSStatus FSCloseDir ( FSClient client,
FSCmdBlock block,
FSDirectoryHandle  handle,
FSErrorFlag  errorMask 
)

◆ FSGetVolumeInfo()

FSStatus FSGetVolumeInfo ( FSClient client,
FSCmdBlock block,
const char *  path,
FSVolumeInfo volumeInfo,
FSErrorFlag  errorMask 
)

◆ FSGetVolumeInfoAsync()

FSStatus FSGetVolumeInfoAsync ( FSClient client,
FSCmdBlock block,
const char *  path,
FSVolumeInfo volumeInfo,
FSErrorFlag  errorMask,
FSAsyncData asyncData 
)

◆ FSCloseDirAsync()

FSStatus FSCloseDirAsync ( FSClient client,
FSCmdBlock block,
FSDirectoryHandle  handle,
FSErrorFlag  errorMask,
FSAsyncData asyncData 
)

◆ FSChangeMode()

FSStatus FSChangeMode ( FSClient client,
FSCmdBlock block,
const char *  path,
FSMode  mode,
FSMode  modeMask,
FSErrorFlag  errorMask 
)

◆ FSChangeModeAsync()

FSStatus FSChangeModeAsync ( FSClient client,
FSCmdBlock block,
const char *  path,
FSMode  mode,
FSMode  modeMask,
FSErrorFlag  errorMask,
FSAsyncData asyncData 
)

◆ FSGetFreeSpaceSize()

FSStatus FSGetFreeSpaceSize ( FSClient client,
FSCmdBlock block,
const char *  path,
uint64_t *  outSize,
FSErrorFlag  errorMask 
)

◆ FSGetFreeSpaceSizeAsync()

FSStatus FSGetFreeSpaceSizeAsync ( FSClient client,
FSCmdBlock block,
const char *  path,
uint64_t *  outSize,
FSErrorFlag  errorMask,
FSAsyncData asyncData 
)

◆ FSGetStatFile()

FSStatus FSGetStatFile ( FSClient client,
FSCmdBlock block,
FSFileHandle  handle,
FSStat stat,
FSErrorFlag  errorMask 
)

◆ FSGetStatFileAsync()

FSStatus FSGetStatFileAsync ( FSClient client,
FSCmdBlock block,
FSFileHandle  handle,
FSStat stat,
FSErrorFlag  errorMask,
FSAsyncData asyncData 
)

◆ FSReadFile()

FSStatus FSReadFile ( FSClient client,
FSCmdBlock block,
uint8_t *  buffer,
uint32_t  size,
uint32_t  count,
FSFileHandle  handle,
uint32_t  unk1,
FSErrorFlag  errorMask 
)

◆ FSReadFileAsync()

FSStatus FSReadFileAsync ( FSClient client,
FSCmdBlock block,
uint8_t *  buffer,
uint32_t  size,
uint32_t  count,
FSFileHandle  handle,
uint32_t  unk1,
FSErrorFlag  errorMask,
FSAsyncData asyncData 
)

◆ FSReadFileWithPos()

FSStatus FSReadFileWithPos ( FSClient client,
FSCmdBlock block,
uint8_t *  buffer,
uint32_t  size,
uint32_t  count,
uint32_t  pos,
FSFileHandle  handle,
uint32_t  unk1,
FSErrorFlag  errorMask 
)

◆ FSReadFileWithPosAsync()

FSStatus FSReadFileWithPosAsync ( FSClient client,
FSCmdBlock block,
uint8_t *  buffer,
uint32_t  size,
uint32_t  count,
uint32_t  pos,
FSFileHandle  handle,
uint32_t  unk1,
FSErrorFlag  errorMask,
FSAsyncData asyncData 
)

◆ FSWriteFile()

FSStatus FSWriteFile ( FSClient client,
FSCmdBlock block,
uint8_t *  buffer,
uint32_t  size,
uint32_t  count,
FSFileHandle  handle,
uint32_t  unk1,
FSErrorFlag  errorMask 
)

◆ FSWriteFileAsync()

FSStatus FSWriteFileAsync ( FSClient client,
FSCmdBlock block,
uint8_t *  buffer,
uint32_t  size,
uint32_t  count,
FSFileHandle  handle,
uint32_t  unk1,
FSErrorFlag  errorMask,
FSAsyncData asyncData 
)

◆ FSWriteFileWithPos()

FSStatus FSWriteFileWithPos ( FSClient client,
FSCmdBlock block,
uint8_t *  buffer,
uint32_t  size,
uint32_t  count,
uint32_t  pos,
FSFileHandle  handle,
uint32_t  unk1,
FSErrorFlag  errorMask 
)

◆ FSWriteFileWithPosAsync()

FSStatus FSWriteFileWithPosAsync ( FSClient client,
FSCmdBlock block,
uint8_t *  buffer,
uint32_t  size,
uint32_t  count,
uint32_t  pos,
FSFileHandle  handle,
uint32_t  unk1,
FSErrorFlag  errorMask,
FSAsyncData asyncData 
)

◆ FSGetPosFile()

FSStatus FSGetPosFile ( FSClient client,
FSCmdBlock block,
FSFileHandle  fileHandle,
uint32_t *  pos,
FSErrorFlag  errorMask 
)

◆ FSGetPosFileAsync()

FSStatus FSGetPosFileAsync ( FSClient client,
FSCmdBlock block,
FSFileHandle  fileHandle,
uint32_t *  pos,
FSErrorFlag  errorMask,
FSAsyncData asyncData 
)

◆ FSSetPosFile()

FSStatus FSSetPosFile ( FSClient client,
FSCmdBlock block,
FSFileHandle  handle,
uint32_t  pos,
FSErrorFlag  errorMask 
)

◆ FSSetPosFileAsync()

FSStatus FSSetPosFileAsync ( FSClient client,
FSCmdBlock block,
FSFileHandle  handle,
uint32_t  pos,
FSErrorFlag  errorMask,
FSAsyncData asyncData 
)

◆ FSFlushFile()

FSStatus FSFlushFile ( FSClient client,
FSCmdBlock block,
FSFileHandle  handle,
FSErrorFlag  errorMask 
)

◆ FSFlushFileAsync()

FSStatus FSFlushFileAsync ( FSClient client,
FSCmdBlock block,
FSFileHandle  handle,
FSErrorFlag  errorMask,
FSAsyncData asyncData 
)

◆ FSTruncateFile()

FSStatus FSTruncateFile ( FSClient client,
FSCmdBlock block,
FSFileHandle  handle,
FSErrorFlag  errorMask 
)

◆ FSTruncateFileAsync()

FSStatus FSTruncateFileAsync ( FSClient client,
FSCmdBlock block,
FSFileHandle  handle,
FSErrorFlag  errorMask,
FSAsyncData asyncData 
)

◆ FSRename()

FSStatus FSRename ( FSClient client,
FSCmdBlock block,
const char *  oldPath,
const char *  newPath,
FSErrorFlag  errorMask 
)

◆ FSRenameAsync()

FSStatus FSRenameAsync ( FSClient client,
FSCmdBlock block,
const char *  oldPath,
const char *  newPath,
FSErrorFlag  errorMask,
FSAsyncData asyncData 
)

◆ FSGetVolumeState()

FSVolumeState FSGetVolumeState ( FSClient client)

◆ FSGetLastError()

FSError FSGetLastError ( FSClient client)

◆ FSGetLastErrorCodeForViewer()

FSError FSGetLastErrorCodeForViewer ( FSClient client)

◆ FSGetMountSource()

FSStatus FSGetMountSource ( FSClient client,
FSCmdBlock cmd,
FSMountSourceType  type,
FSMountSource out,
FSErrorFlag  errorMask 
)

◆ FSMount()

FSStatus FSMount ( FSClient client,
FSCmdBlock cmd,
FSMountSource source,
const char *  target,
uint32_t  bytes,
FSErrorFlag  errorMask 
)

◆ FSUnmount()

FSStatus FSUnmount ( FSClient client,
FSCmdBlock cmd,
const char *  target,
FSErrorFlag  errorMask 
)

◆ FSBindMount()

FSStatus FSBindMount ( FSClient client,
FSCmdBlock cmd,
const char *  source,
const char *  target,
FSErrorFlag  errorMask 
)

◆ FSBindUnmount()

FSStatus FSBindUnmount ( FSClient client,
FSCmdBlock cmd,
const char *  target,
FSErrorFlag  errorMask 
)

◆ FSTimeToCalendarTime()

void FSTimeToCalendarTime ( FSTime  time,
OSCalendarTime outCalendarTime 
)

File times aren't always available in which case it returns the default 1980-01-01.