MCPcopy Create free account
hub / github.com/andysworkshop/stm32plus / writeDirectoryEntry

Method writeDirectoryEntry

lib/src/filesystem/fat/FatFileSystem.cpp:823–840  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

821 */
822
823 bool FatFileSystem::writeDirectoryEntry(DirectoryEntryWithLocation& dirent_) {
824
825 ByteMemblock sector(getSectorSizeInBytes());
826
827 // read the sector containing the directory entry
828
829 if(!readSector(dirent_.SectorNumber,sector))
830 return false;
831
832 // copy the dirent into the sector
833
834 DirectoryEntry& dirent=dirent_.Dirent;
835 memcpy(sector + sizeof(DirectoryEntry) * dirent_.IndexWithinSector,&dirent,sizeof(DirectoryEntry));
836
837 // write back the sector
838
839 return writeSector(dirent_.SectorNumber,sector);
840 }
841
842 /**
843 * Find a free cluster. This implementation - being for an MCU - assumes that the FS is likely to

Callers 3

extendDirectoryMethod · 0.80
writeDirentsMethod · 0.80
writeMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected