diff --git a/cudir.cc b/cudir.cc index 986240a..57317b4 100644 --- a/cudir.cc +++ b/cudir.cc @@ -20,7 +20,19 @@ getEntries( const std::filesystem::path where ) for( const auto &entry: std::filesystem::directory_iterator{ where } ) { - const auto time= std::filesystem::file_time_type::clock::to_sys( last_write_time( entry.path() ) ); + auto time= Alepha::Utility::evaluate <=[&] + { + using time_type= decltype( std::filesystem::file_time_type::clock::to_sys( last_write_time( entry.path() ) ) ); + try + { + return std::filesystem::file_time_type::clock::to_sys( last_write_time( entry.path() ) ); + } + catch( const std::filesystem::filesystem_error & ) + { + time_type rv; + return rv; + } + }; const auto day= std::chrono::floor< std::chrono::days >( time ); const std::chrono::year_month_day ymd{ day }; const auto time_since_midnight= day - time;