temp fix for create_directories

This commit is contained in:
georgemoralis 2023-11-07 09:58:55 +02:00
parent 461215a6f5
commit 429d7deb29
2 changed files with 10 additions and 4 deletions

View File

@ -32,8 +32,8 @@ struct File {
std::string m_host_name; std::string m_host_name;
std::string m_guest_name; std::string m_guest_name;
Common::FS::File f; Common::FS::File f;
std::vector<Common::FS::DirEntry> dents;
u32 dents_index;
}; };
class HandleTable { class HandleTable {
public: public:

View File

@ -32,12 +32,18 @@ int PS4_SYSV_ABI sceKernelOpen(const char* path, int flags, u16 mode) {
file->m_host_name = mnt->getHostDirectory(file->m_guest_name); file->m_host_name = mnt->getHostDirectory(file->m_guest_name);
if (!std::filesystem::is_directory(file->m_host_name)) { // directory doesn't exist if (!std::filesystem::is_directory(file->m_host_name)) { // directory doesn't exist
if (create) { // if we have a create flag create it if (create) { // if we have a create flag create it
if (std::filesystem::create_directories(file->m_host_name)) { /* std::error_code e;
if (std::filesystem::create_directories(file->m_host_name,e)) {
return handle; return handle;
} else { } else {
std::string message =e.message();
return SCE_KERNEL_ERROR_ENOTDIR; return SCE_KERNEL_ERROR_ENOTDIR;
} }
return SCE_KERNEL_ERROR_ENOTDIR; return SCE_KERNEL_ERROR_ENOTDIR;*/
//there is seems to be a bug with create_directories return false even if the directory creates so don't check until we find
//a better solution
std::filesystem::create_directories(file->m_host_name);
return handle;
} }
} else { } else {
if (create) { if (create) {