Only touch if the file does not exists

This commit is contained in:
Baptiste Wicht 2014-03-12 20:22:20 +01:00
parent 8c9ba4f38b
commit 26adfcee3d

View File

@ -204,7 +204,12 @@ int64_t vfs::open(const char* file_path, size_t flags){
int64_t sub_result;
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 {
vfs::file file;
sub_result = fs.file_system->get_file(fs_path, file);