19#ifndef MBED_FATFILESYSTEM_H
20#define MBED_FATFILESYSTEM_H
22#include "filesystem/FileSystem.h"
23#include "blockdevice/BlockDevice.h"
24#include "FileHandle.h"
26#include "rtos/Mutex.h"
27#include "storage/filesystem/fat/ChaN/ff.h"
128 virtual int rename(
const char *path,
const char *newpath);
136 virtual int stat(
const char *path,
struct stat *st);
144 virtual int mkdir(
const char *path, mode_t mode);
164 virtual int file_open(fs_file_t *file,
const char *path,
int flags);
171 virtual int file_close(fs_file_t file);
180 virtual ssize_t file_read(fs_file_t file,
void *buffer,
size_t len);
189 virtual ssize_t file_write(fs_file_t file,
const void *buffer,
size_t len);
196 virtual int file_sync(fs_file_t file);
208 virtual off_t file_seek(fs_file_t file, off_t offset,
int whence);
215 virtual off_t file_tell(fs_file_t file);
222 virtual off_t file_size(fs_file_t file);
235 virtual int file_truncate(mbed::fs_file_t file, off_t length);
243 virtual int dir_open(fs_dir_t *dir,
const char *path);
250 virtual int dir_close(fs_dir_t dir);
258 virtual ssize_t dir_read(fs_dir_t dir,
struct dirent *ent);
266 virtual void dir_seek(fs_dir_t dir, off_t offset);
273 virtual off_t dir_tell(fs_dir_t dir);
279 virtual void dir_rewind(fs_dir_t dir);
284 char _fsid[
sizeof(
"0:")];
289 virtual void unlock();
299#ifndef MBED_NO_GLOBAL_USING_DIRECTIVE
A hardware device capable of writing and reading blocks.
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 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 reformat(BlockDevice *bd, int allocation_unit)
Reformat a file system, results in an empty and mounted file system.
virtual int mount(BlockDevice *bd)
Mount a file system to a block device.
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 remove(const char *path)
Remove a file from the file system.
virtual int unmount()
Unmount a file system from the underlying block device.
virtual int statvfs(const char *path, struct statvfs *buf)
Store information about the mounted file system in a statvfs structure.
virtual int rename(const char *path, const char *newpath)
Rename a file in the file system.
uint64_t bd_size_t
Type representing a quantity of 8-bit bytes.