| 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 |
no outgoing calls
no test coverage detected