mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-27 01:02:48 +01:00
Revert "Merge pull request #5176 from Morph1984/fix-createfile"
This reverts commit6d6115475b
, reversing changes made to5fe55b16a1
.
This commit is contained in:
parent
0195038c07
commit
dfee6321cd
1 changed files with 2 additions and 6 deletions
|
@ -94,13 +94,9 @@ VirtualFile RealVfsFilesystem::OpenFile(std::string_view path_, Mode perms) {
|
||||||
|
|
||||||
VirtualFile RealVfsFilesystem::CreateFile(std::string_view path_, Mode perms) {
|
VirtualFile RealVfsFilesystem::CreateFile(std::string_view path_, Mode perms) {
|
||||||
const auto path = FS::SanitizePath(path_, FS::DirectorySeparator::PlatformDefault);
|
const auto path = FS::SanitizePath(path_, FS::DirectorySeparator::PlatformDefault);
|
||||||
const auto parent_path = FS::GetParentPath(path);
|
const auto path_fwd = FS::SanitizePath(path, FS::DirectorySeparator::ForwardSlash);
|
||||||
|
|
||||||
if (!FS::Exists(path)) {
|
if (!FS::Exists(path)) {
|
||||||
if (!FS::CreateDirs(parent_path)) {
|
FS::CreateFullPath(path_fwd);
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!FS::CreateEmptyFile(path)) {
|
if (!FS::CreateEmptyFile(path)) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue