Fix mkdir not to overwrite an existing dir
This commit is contained in:
parent
57fe7aafc5
commit
afe2148a17
4
deps/ox/src/ox/fs/filesystem.hpp
vendored
4
deps/ox/src/ox/fs/filesystem.hpp
vendored
@ -368,8 +368,12 @@ int FileSystemTemplate<FileStore, FS_TYPE>::stripDirectories() {
|
||||
|
||||
template<typename FileStore, FsType FS_TYPE>
|
||||
int FileSystemTemplate<FileStore, FS_TYPE>::mkdir(const char *path) {
|
||||
if (!stat(path).inode) {
|
||||
Directory<typename FileStore::InodeId_t, typename FileStore::FsSize_t> dir;
|
||||
return write(path, &dir, sizeof(dir), FileType::FileType_Directory);
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
template<typename FileStore, FsType FS_TYPE>
|
||||
|
Loading…
Reference in New Issue
Block a user