From a19fe8260a4e1f4cb9d523f5b2cb41eae0a61acd Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 23 Dec 2022 20:14:59 +0100 Subject: Add File::open_error(). --- src/file.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/file.h') diff --git a/src/file.h b/src/file.h index edc431bd..22083a9e 100644 --- a/src/file.h +++ b/src/file.h @@ -101,9 +101,17 @@ public: return _file; } + /** @return Error returned by the fopen / _wfopen call; + * errno on POSIX, GetLastError() on Windows. + */ + int open_error() const { + return _open_error; + } + private: boost::filesystem::path _path; FILE* _file = nullptr; + int _open_error = 0; }; -- cgit v1.2.3