additional filesystem abstractions

This commit is contained in:
2022-09-05 17:42:56 +02:00
parent 5a3f05fa79
commit 2e4cdb7366
9 changed files with 102 additions and 46 deletions

View File

@ -144,3 +144,17 @@ ReturnValue_t HostFilesystem::rename(const char *oldPath_, const char *newPath_,
}
return returnvalue::OK;
}
bool HostFilesystem::fileExists(FilesystemParams params) {
path path(params.path);
return filesystem::exists(path);
}
ReturnValue_t HostFilesystem::truncateFile(FilesystemParams params) {
path path(params.path);
if (not filesystem::exists(path)) {
return FILE_DOES_NOT_EXIST;
}
ofstream of(path);
return returnvalue::OK;
}