void EFile::rm(uint8_t i_fileId){ uint8_t i = eeFs->files[i_fileId].startBlk; memset(&(eeFs->files[i_fileId]), 0, sizeof(eeFs->files[i_fileId])); EeFsFlush(); //chained out if(i) EeFsFree( i ); //chain in }
void EFile::rm(uint8_t i_fileId) { blkid_t i = eeFs.files[i_fileId].startBlk; memclear(&eeFs.files[i_fileId], sizeof(eeFs.files[i_fileId])); ENABLE_SYNC_WRITE(true); EeFsFlushDirEnt(i_fileId); if (i) EeFsFree(i); //chain in ENABLE_SYNC_WRITE(false); }
void EFile::closeTrunc() { uint8_t fri=0; eeFs->files[m_fileId].size = m_pos; if(m_currBlk && ( fri = EeFsGetLink(m_currBlk))) EeFsSetLink(m_currBlk, 0); EeFsFlush(); //chained out if(fri) EeFsFree( fri ); //chain in }