10#define IO_WHENCE_BEGIN 0
11#define IO_WHENCE_CURRENT 1
12#define IO_WHENCE_END 2
14#define IO_FILEMODE_READ 0
15#define IO_FILEMODE_WRITE 1
75extern uint32_t
fs_read(
IOFILE *filehandle,
void *buffer, uint32_t readLen);
82extern uint32_t
fs_write(
IOFILE *filehandle,
const void *buffer, uint32_t readLen);
89extern uint32_t
fs_seek(
IOFILE *filehandle, int32_t position, uint32_t whence);
void fs_close(IOFILE *filehandle)
Close a previously opened file stream.
void fs_closeDir(IODIR *dirHandle)
Close open directory.
IODIRENT * fs_readDir(IODIR *dirHandle)
Reads the next directory entry from the open directory.
uint32_t fs_seek(IOFILE *filehandle, int32_t position, uint32_t whence)
Seek to a position within the open file stream.
uint8_t fs_eof(IOFILE *filehandle)
Retrieve whether the given file stream's position is at its end.
IOFILE * fs_allocMemoryCard(const char *filename, const void *icon, const uint16_t *iconPalette, uint32_t numBlocks)
Allocate a new file on the memory card.
IODIR * fs_openDir(const char *path)
Open a directory.
uint8_t fs_deviceExists(const char *device)
Check if the given storage device is present.
void fs_rewindDir(IODIR *dirHandle)
Rewind open directory to the beginning of the listing.
uint32_t fs_read(IOFILE *filehandle, void *buffer, uint32_t readLen)
Read data from an open file stream.
uint32_t fs_tell(IOFILE *filehandle)
Retrieve the current position within the open file stream.
void IODIR
Opaque handle to an open directory.
void IOFILE
Opaque handle to an open file descriptor.
uint8_t fs_fileExists(const char *filepath)
Check if the file exists.
void fs_deviceEject(const char *device)
Eject the given storage device, if it supports it.
uint32_t fs_write(IOFILE *filehandle, const void *buffer, uint32_t readLen)
Write to an open file stream.
IOFILE * fs_open(const char *filepath, uint32_t mode)
Open a file for reading.
Directory entry detailing information about a file or directory.
uint64_t created
A timestamp representing the time this file or directory was created.
uint64_t modified
A timestamp representing the time this file or directory was last modified.
uint32_t isDirectory
True if this is a directory, false otherwise.
uint32_t size
The size of this file in bytes (0 if this is a directory)