mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-01-07 15:46:01 +00:00
Linux unlink implementation (#1347)
This commit is contained in:
parent
dbed4afe1f
commit
1260bd5730
|
@ -231,7 +231,7 @@ void IOFile::Unlink() {
|
||||||
|
|
||||||
// Mark the file for deletion
|
// Mark the file for deletion
|
||||||
// TODO: Also remove the file path?
|
// TODO: Also remove the file path?
|
||||||
#if _WIN64
|
#ifdef _WIN64
|
||||||
FILE_DISPOSITION_INFORMATION disposition;
|
FILE_DISPOSITION_INFORMATION disposition;
|
||||||
IO_STATUS_BLOCK iosb;
|
IO_STATUS_BLOCK iosb;
|
||||||
|
|
||||||
|
@ -242,7 +242,11 @@ void IOFile::Unlink() {
|
||||||
NtSetInformationFile(hfile, &iosb, &disposition, sizeof(disposition),
|
NtSetInformationFile(hfile, &iosb, &disposition, sizeof(disposition),
|
||||||
FileDispositionInformation);
|
FileDispositionInformation);
|
||||||
#else
|
#else
|
||||||
UNREACHABLE_MSG("Missing Linux implementation");
|
if (unlink(file_path.c_str()) != 0) {
|
||||||
|
const auto ec = std::error_code{errno, std::generic_category()};
|
||||||
|
LOG_ERROR(Common_Filesystem, "Failed to unlink the file at path={}, ec_message={}",
|
||||||
|
PathToUTF8String(file_path), ec.message());
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue