26 #ifndef MBED_FATFILESYSTEM_H 27 #define MBED_FATFILESYSTEM_H 29 #include "filesystem/FileSystem.h" 30 #include "blockdevice/BlockDevice.h" 31 #include "FileHandle.h" 33 #include "PlatformMutex.h" 34 #include "storage/filesystem/fat/ChaN/ff.h" 122 virtual int remove(
const char *path);
130 virtual int rename(
const char *path,
const char *newpath);
138 virtual int stat(
const char *path,
struct stat *st);
146 virtual int mkdir(
const char *path, mode_t mode);
166 virtual int file_open(fs_file_t *file,
const char *path,
int flags);
173 virtual int file_close(fs_file_t file);
182 virtual ssize_t file_read(fs_file_t file,
void *buffer,
size_t len);
191 virtual ssize_t file_write(fs_file_t file,
const void *buffer,
size_t len);
198 virtual int file_sync(fs_file_t file);
210 virtual off_t file_seek(fs_file_t file, off_t offset,
int whence);
217 virtual off_t file_tell(fs_file_t file);
224 virtual off_t file_size(fs_file_t file);
237 virtual int file_truncate(mbed::fs_file_t file, off_t length);
245 virtual int dir_open(fs_dir_t *dir,
const char *path);
252 virtual int dir_close(fs_dir_t dir);
260 virtual ssize_t dir_read(fs_dir_t dir,
struct dirent *ent);
268 virtual void dir_seek(fs_dir_t dir, off_t offset);
275 virtual off_t dir_tell(fs_dir_t dir);
281 virtual void dir_rewind(fs_dir_t dir);
286 char _fsid[
sizeof(
"0:")];
291 virtual void unlock();
298 #ifndef MBED_NO_GLOBAL_USING_DIRECTIVE virtual int rename(const char *path, const char *newpath)
Rename a file in the file system.
virtual int statvfs(const char *path, struct statvfs *buf)
Store information about the mounted file system in a statvfs structure.
A hardware device capable of writing and reading blocks.
virtual int mkdir(const char *path, mode_t mode)
Create a directory in the file system.
static int format(BlockDevice *bd, bd_size_t cluster_size=0)
Format a logical drive, FDISK partitioning rule.
virtual int stat(const char *path, struct stat *st)
Store information about the file in a stat structure.
virtual int reformat(BlockDevice *bd=NULL)
Reformat a file system, results in an empty and mounted file system.
virtual int reformat(BlockDevice *bd, int allocation_unit)
Reformat a file system, results in an empty and mounted file system.
FAT file system based on ChaN's FAT file system library v0.8.
FATFileSystem(const char *name=NULL, BlockDevice *bd=NULL)
Lifetime of the FAT file system.
virtual int mount(BlockDevice *bd)
Mount a file system to a block device.
virtual int unmount()
Unmount a file system from the underlying block device.