diff --git a/lib/external/libwolv b/lib/external/libwolv index 6c26a4933..ef8dd504a 160000 --- a/lib/external/libwolv +++ b/lib/external/libwolv @@ -1 +1 @@ -Subproject commit 6c26a4933891f997142b64572fe86d51cb36bff7 +Subproject commit ef8dd504a9173b0a2f25aa52563649e5777536cf diff --git a/plugins/builtin/source/content/providers/file_provider.cpp b/plugins/builtin/source/content/providers/file_provider.cpp index fc17496e9..b5ad55455 100644 --- a/plugins/builtin/source/content/providers/file_provider.cpp +++ b/plugins/builtin/source/content/providers/file_provider.cpp @@ -202,8 +202,10 @@ namespace hex::plugin::builtin { size_t fileSize = 0x00; { wolv::io::File file(m_path, wolv::io::File::Mode::Read); - if (!file.isValid()) + if (!file.isValid()) { + this->setErrorMessage(hex::format("hex.builtin.provider.file.error.open"_lang, m_path.string(), std::system_category().message(file.getOpenError().value_or(0)))); return false; + } fileSize = file.getSize(); } @@ -231,11 +233,6 @@ namespace hex::plugin::builtin { m_readable = true; m_writable = true; - if (!wolv::io::fs::exists(m_path)) { - this->setErrorMessage(hex::format("hex.builtin.provider.file.error.open"_lang, m_path.string(), std::system_category().message(ENOENT))); - return false; - } - wolv::io::File file(m_path, wolv::io::File::Mode::Write); if (!file.isValid()) { m_writable = false; @@ -243,7 +240,7 @@ namespace hex::plugin::builtin { file = wolv::io::File(m_path, wolv::io::File::Mode::Read); if (!file.isValid()) { m_readable = false; - this->setErrorMessage(hex::format("hex.builtin.provider.file.error.open"_lang, m_path.string(), std::system_category().message(errno))); + this->setErrorMessage(hex::format("hex.builtin.provider.file.error.open"_lang, m_path.string(), std::system_category().message(file.getOpenError().value_or(0)))); return false; }