Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
cmake_minimum_required( VERSION 3.14 )

project( "daw-header-libraries"
VERSION "2.132.2"
VERSION "2.132.3"
DESCRIPTION "Various headers"
HOMEPAGE_URL "https://github.com/beached/header_libraries"
LANGUAGES C CXX
Expand Down
12 changes: 10 additions & 2 deletions include/daw/daw_read_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ namespace daw {
template<typename CharT = char>
DAW_ATTRIB_NOINLINE std::optional<std::basic_string<CharT>>
read_file( std::string const &path ) {
auto const fsize = std::filesystem::file_size( path );
auto ec = std::error_code{};
auto const fsize = std::filesystem::file_size( path, ec );
if( ec ) {
return std::nullopt;
}
if( fsize == 0 ) {
return std::basic_string<CharT>{ };
}
Expand Down Expand Up @@ -73,7 +77,11 @@ namespace daw {
DAW_ATTRIB_NOINLINE inline std::optional<std::wstring>
read_wfile( std::wstring path ) {
using CharT = wchar_t;
auto const fsize = std::filesystem::file_size( path );
auto ec = std::error_code{};
auto const fsize = std::filesystem::file_size( path, ec );
if( ec ) {
return std::nullopt;
}
if( fsize == 0 ) {
return std::basic_string<CharT>{ };
}
Expand Down
Loading