MCPcopy Create free account
hub / github.com/SmingHub/Sming / remove

Method remove

Sming/Libraries/Spiffs/src/FileSystem.cpp:825–848  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

823}
824
825int FileSystem::remove(const char* path)
826{
827 if(isRootPath(path)) {
828 return Error::BadParam;
829 }
830
831 // Check file is not marked read-only
832 int f = open(path, OpenFlag::Read);
833 if(f >= 0) {
834 auto smb = getMetaBuffer(f);
835 assert(smb != nullptr);
836 auto attr = smb->meta.attr;
837 close(f);
838 if(attr[FileAttribute::ReadOnly]) {
839 return Error::ReadOnly;
840 }
841 }
842
843 int err = SPIFFS_remove(handle(), path);
844 err = translateSpiffsError(err);
845 debug_ifserr(err, "remove('%s')", path);
846 partition.sync();
847 return err;
848}
849
850int FileSystem::fremove(FileHandle file)
851{

Callers 5

jquery.jsFile · 0.45
dFunction · 0.45
jquery.jsFile · 0.45
VbFunction · 0.45
unregisterCommandMethod · 0.45

Calls 2

translateSpiffsErrorFunction · 0.85
syncMethod · 0.45

Tested by

no test coverage detected