16 FsDefs::RESULT FsFile::open(
const char* path,
bool readOnly) {
17 return FsEntry::open(path, readOnly,
false,
false);
20 FsDefs::RESULT FsFile::create(
const char* path,
bool readOnly) {
21 return FsEntry::open(path, readOnly,
true,
false);
24 FsDefs::RESULT FsFile::read(
void* buffer,
size_t len,
size_t* transfered) {
26 return FsDefs::RES_ENTRY_NOT_OPEN;
30 return FsDefs::RES_SUCCESS;
32 return Fs::read(buffer, len, transfered,
this);
35 FsDefs::RESULT FsFile::write(
const void* buffer,
size_t len,
size_t* transfered) {
37 return FsDefs::RES_ENTRY_NOT_OPEN;
39 if (mFlags.bits.readOnly) {
40 return FsDefs::RES_DENIED;
43 return FsDefs::RES_SUCCESS;
45 mFlags.bits.unflushedSector =
true;
46 return Fs::write(buffer, len, transfered,
this);
49 FsDefs::RESULT FsFile::seek(
size_t position) {
51 return FsDefs::RES_ENTRY_NOT_OPEN;
53 FsDefs::RESULT result = Fs::flush(
this);
54 if (result == FsDefs::RES_SUCCESS) {
55 result = Fs::seek(
this, position);
60 FsDefs::RESULT FsFile::flush() {
61 FsDefs::RESULT result = Fs::flush(
this);
65 FsDefs::RESULT FsFile::close() {
66 FsDefs::RESULT result = FsDefs::RES_ENTRY_NOT_OPEN;
68 result = Fs::flush(
this);
75 FsDefs::RESULT FsFile::del(
const char* path) {
76 return FsEntry::del(path,
false);
79 uint32_t FsFile::getSize() {