[Kernel] Added Support For: XFileRenameInformation

This commit is contained in:
Gliniak
2024-01-29 22:03:58 +01:00
parent 8b14b4bbc4
commit 74b52711a3
11 changed files with 134 additions and 64 deletions

View File

@@ -15,6 +15,7 @@
#include "xenia/base/math.h"
#include "xenia/base/string.h"
#include "xenia/vfs/device.h"
#include "xenia/vfs/devices/host_path_device.h"
#include "xenia/vfs/devices/host_path_file.h"
namespace xe {
@@ -110,6 +111,15 @@ bool HostPathEntry::DeleteEntryInternal(Entry* entry) {
}
}
void HostPathEntry::RenameEntryInternal(const std::filesystem::path file_path) {
const std::string new_host_path_ = xe::utf8::join_paths(
xe::path_to_utf8(((HostPathDevice*)device_)->host_path()),
xe::path_to_utf8(file_path));
std::filesystem::rename(host_path_, new_host_path_);
host_path_ = new_host_path_;
}
void HostPathEntry::update() {
xe::filesystem::FileInfo file_info;
if (!xe::filesystem::GetInfo(host_path_, &file_info)) {