mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-10 13:04:53 -04:00
Only touch if the file does not exists
This commit is contained in:
parent
8c9ba4f38b
commit
26adfcee3d
@ -204,7 +204,12 @@ int64_t vfs::open(const char* file_path, size_t flags){
|
|||||||
|
|
||||||
int64_t sub_result;
|
int64_t sub_result;
|
||||||
if(flags & std::OPEN_CREATE){
|
if(flags & std::OPEN_CREATE){
|
||||||
sub_result = fs.file_system->touch(fs_path);
|
vfs::file file;
|
||||||
|
sub_result = fs.file_system->get_file(fs_path, file);
|
||||||
|
|
||||||
|
if(sub_result == std::ERROR_NOT_EXISTS){
|
||||||
|
sub_result = fs.file_system->touch(fs_path);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
vfs::file file;
|
vfs::file file;
|
||||||
sub_result = fs.file_system->get_file(fs_path, file);
|
sub_result = fs.file_system->get_file(fs_path, file);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user