21 #ifndef MBED_FATFILESYSTEM_H 22 #define MBED_FATFILESYSTEM_H 24 #include "filesystem/FileSystem.h" 25 #include "blockdevice/BlockDevice.h" 26 #include "FileHandle.h" 28 #include "PlatformMutex.h" 29 #include "storage/filesystem/fat/ChaN/ff.h" 117 virtual int remove(
const char *path);
125 virtual int rename(
const char *path,
const char *newpath);
133 virtual int stat(
const char *path,
struct stat *st);
141 virtual int mkdir(
const char *path, mode_t mode);
161 virtual int file_open(fs_file_t *file,
const char *path,
int flags);
168 virtual int file_close(fs_file_t file);
177 virtual ssize_t file_read(fs_file_t file,
void *buffer,
size_t len);
186 virtual ssize_t file_write(fs_file_t file,
const void *buffer,
size_t len);
193 virtual int file_sync(fs_file_t file);
205 virtual off_t file_seek(fs_file_t file, off_t offset,
int whence);
212 virtual off_t file_tell(fs_file_t file);
219 virtual off_t file_size(fs_file_t file);
232 virtual int file_truncate(mbed::fs_file_t file, off_t length);
240 virtual int dir_open(fs_dir_t *dir,
const char *path);
247 virtual int dir_close(fs_dir_t dir);
255 virtual ssize_t dir_read(fs_dir_t dir,
struct dirent *ent);
263 virtual void dir_seek(fs_dir_t dir, off_t offset);
270 virtual off_t dir_tell(fs_dir_t dir);
276 virtual void dir_rewind(fs_dir_t dir);
281 char _fsid[
sizeof(
"0:")];
286 virtual void unlock();
293 #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.