mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-08-29 18:08:08 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7b8fc7e804 |
@@ -227,12 +227,13 @@ Result VfsDirectoryServiceWrapper::RenameDirectory(const std::string& src_path_,
|
|||||||
std::string src_path(Common::FS::SanitizePath(src_path_));
|
std::string src_path(Common::FS::SanitizePath(src_path_));
|
||||||
std::string dest_path(Common::FS::SanitizePath(dest_path_));
|
std::string dest_path(Common::FS::SanitizePath(dest_path_));
|
||||||
auto src = GetDirectoryRelativeWrapped(backing, src_path);
|
auto src = GetDirectoryRelativeWrapped(backing, src_path);
|
||||||
|
if (src == nullptr)
|
||||||
|
return FileSys::ResultPathNotFound;
|
||||||
|
|
||||||
if (Common::FS::GetParentPath(src_path) == Common::FS::GetParentPath(dest_path)) {
|
if (Common::FS::GetParentPath(src_path) == Common::FS::GetParentPath(dest_path)) {
|
||||||
// Use more-optimized vfs implementation rename.
|
std::string full_src_path = backing->GetFullPath() + "/" + src_path;
|
||||||
if (src == nullptr)
|
std::string full_dest_path = backing->GetFullPath() + "/" + dest_path;
|
||||||
return FileSys::ResultPathNotFound;
|
if (!Common::FS::RenameDir(full_src_path, full_dest_path)) {
|
||||||
if (!src->Rename(Common::FS::GetFilename(dest_path))) {
|
|
||||||
// TODO(DarkLordZach): Find a better error code for this
|
|
||||||
return ResultUnknown;
|
return ResultUnknown;
|
||||||
}
|
}
|
||||||
return ResultSuccess;
|
return ResultSuccess;
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ IFileSystem::IFileSystem(Core::System& system_, FileSys::VirtualDir dir_, SizeGe
|
|||||||
{3, D<&IFileSystem::DeleteDirectory>, "DeleteDirectory"},
|
{3, D<&IFileSystem::DeleteDirectory>, "DeleteDirectory"},
|
||||||
{4, D<&IFileSystem::DeleteDirectoryRecursively>, "DeleteDirectoryRecursively"},
|
{4, D<&IFileSystem::DeleteDirectoryRecursively>, "DeleteDirectoryRecursively"},
|
||||||
{5, D<&IFileSystem::RenameFile>, "RenameFile"},
|
{5, D<&IFileSystem::RenameFile>, "RenameFile"},
|
||||||
{6, nullptr, "RenameDirectory"},
|
{6, D<&IFileSystem::RenameDirectory>, "RenameDirectory"},
|
||||||
{7, D<&IFileSystem::GetEntryType>, "GetEntryType"},
|
{7, D<&IFileSystem::GetEntryType>, "GetEntryType"},
|
||||||
{8, D<&IFileSystem::OpenFile>, "OpenFile"},
|
{8, D<&IFileSystem::OpenFile>, "OpenFile"},
|
||||||
{9, D<&IFileSystem::OpenDirectory>, "OpenDirectory"},
|
{9, D<&IFileSystem::OpenDirectory>, "OpenDirectory"},
|
||||||
@@ -88,6 +88,14 @@ Result IFileSystem::RenameFile(
|
|||||||
R_RETURN(backend->RenameFile(FileSys::Path(old_path->str), FileSys::Path(new_path->str)));
|
R_RETURN(backend->RenameFile(FileSys::Path(old_path->str), FileSys::Path(new_path->str)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Result IFileSystem::RenameDirectory(
|
||||||
|
const InLargeData<FileSys::Sf::Path, BufferAttr_HipcPointer> old_path,
|
||||||
|
const InLargeData<FileSys::Sf::Path, BufferAttr_HipcPointer> new_path) {
|
||||||
|
LOG_DEBUG(Service_FS, "called. directory '{}' to directory '{}'", old_path->str, new_path->str);
|
||||||
|
|
||||||
|
R_RETURN(backend->RenameDirectory(FileSys::Path(old_path->str), FileSys::Path(new_path->str)));
|
||||||
|
}
|
||||||
|
|
||||||
Result IFileSystem::OpenFile(OutInterface<IFile> out_interface,
|
Result IFileSystem::OpenFile(OutInterface<IFile> out_interface,
|
||||||
const InLargeData<FileSys::Sf::Path, BufferAttr_HipcPointer> path,
|
const InLargeData<FileSys::Sf::Path, BufferAttr_HipcPointer> path,
|
||||||
u32 mode) {
|
u32 mode) {
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
@@ -36,6 +39,8 @@ public:
|
|||||||
const InLargeData<FileSys::Sf::Path, BufferAttr_HipcPointer> path);
|
const InLargeData<FileSys::Sf::Path, BufferAttr_HipcPointer> path);
|
||||||
Result RenameFile(const InLargeData<FileSys::Sf::Path, BufferAttr_HipcPointer> old_path,
|
Result RenameFile(const InLargeData<FileSys::Sf::Path, BufferAttr_HipcPointer> old_path,
|
||||||
const InLargeData<FileSys::Sf::Path, BufferAttr_HipcPointer> new_path);
|
const InLargeData<FileSys::Sf::Path, BufferAttr_HipcPointer> new_path);
|
||||||
|
Result RenameDirectory(const InLargeData<FileSys::Sf::Path, BufferAttr_HipcPointer> old_path,
|
||||||
|
const InLargeData<FileSys::Sf::Path, BufferAttr_HipcPointer> new_path);
|
||||||
Result OpenFile(OutInterface<IFile> out_interface,
|
Result OpenFile(OutInterface<IFile> out_interface,
|
||||||
const InLargeData<FileSys::Sf::Path, BufferAttr_HipcPointer> path, u32 mode);
|
const InLargeData<FileSys::Sf::Path, BufferAttr_HipcPointer> path, u32 mode);
|
||||||
Result OpenDirectory(OutInterface<IDirectory> out_interface,
|
Result OpenDirectory(OutInterface<IDirectory> out_interface,
|
||||||
|
|||||||
Reference in New Issue
Block a user