diff --git a/src/core/libraries/kernel/file_system.cpp b/src/core/libraries/kernel/file_system.cpp index 4d9b7d846..3321559ed 100644 --- a/src/core/libraries/kernel/file_system.cpp +++ b/src/core/libraries/kernel/file_system.cpp @@ -948,12 +948,13 @@ s32 PS4_SYSV_ABI posix_unlink(const char* path) { auto* file = h->GetFile(host_path); if (file == nullptr) { - // Cannot unlink an unopened file - return ORBIS_OK; + // File to unlink hasn't been opened, manually open and unlink it. + Common::FS::IOFile file(host_path, Common::FS::FileAccessMode::ReadWrite); + file.Unlink(); + } else { + file->f.Unlink(); } - file->f.Unlink(); - LOG_INFO(Kernel_Fs, "Unlinked {}", path); return ORBIS_OK; }