117 int open(
const char* filename, uint8_t oflag =
O_READ);
126 return ((m_flags &
O_RDWR) != 0);
152 int seek(uint32_t pos, uint8_t whence =
SEEK_SET);
160 return (m_current_pos);
179 return (m_file_size);
194 virtual int write(
const void *buf,
size_t size);
205 virtual int write_P(
const void* buf,
size_t size);
213 virtual int getchar();
227 virtual int read(
void* buf,
size_t size);
248 int write(
const void* buf,
size_t size,
bool progmem);
274 static int rm(
const char* filename);
283 static int cd(
const char* filename);
292 static int mkdir(
const char* filename);
301 static int rmdir(
const char* filename);
334 static int read(
void* dest, uint32_t src,
size_t size);
345 static int write(uint32_t dest,
const void* src,
size_t size);
356 static int write_P(uint32_t dest,
const void* src,
size_t size);
366 static int lookup(
const char* filename,
descr_t &entry, uint32_t& addr);
380 static int create(
const char* filename, uint16_t
type, uint8_t flags,
381 descr_t &entry, uint32_t &addr);
390 static int remove(uint32_t addr, uint16_t
type);
static int write(uint32_t dest, const void *src, size_t size)
uint16_t type
Type of file and entry state.
virtual int write(const void *buf, size_t size)
virtual int read(void *buf, size_t size)
static const size_t FILENAME_MAX
static int find_end_of_file(uint32_t sector, uint32_t &pos, uint32_t &size)
static uint32_t current_dir_addr
Directory reference entry.
CFFS::descr_t m_entry
Cached directory entry.
File System Master header.
uint32_t m_entry_addr
Entry address.
static int rm(const char *filename)
static int cd(const char *filename)
static Flash::Device * device
static int mkdir(const char *filename)
static const size_t DIR_MAX
uint8_t m_flags
File open flags.
static int lookup(const char *filename, descr_t &entry, uint32_t &addr)
static int create(const char *filename, uint16_t type, uint8_t flags, descr_t &entry, uint32_t &addr)
char name[FILENAME_MAX]
Printable name of object(zero terminated).
static uint32_t next_free_sector()
static const uint32_t NULL_REF
Open for reading and writing.
uint32_t m_file_size
File size.
static bool begin(Flash::Device *flash)
uint32_t ref
Reference value (pointer).
static int ls(IOStream &outs)
uint32_t m_current_addr
Current flash address.
static int write_P(uint32_t dest, const void *src, size_t size)
static int format(Flash::Device *flash, const char *name)
static int read(void *dest, uint32_t src, size_t size)
static uint32_t next_free_directory()
CFFS::descr_t m_sector
Cached sector header.
uint32_t m_current_pos
Current logical position.
static int rmdir(const char *filename)
uint32_t size
Number of bytes (including header).