From ebe762d3d6300dc9a5177b800876d5a65dbe996e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 4 Nov 2016 08:51:26 +0200 Subject: Add empty(dir_path) to filesystem --- build2/filesystem.cxx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'build2/filesystem.cxx') diff --git a/build2/filesystem.cxx b/build2/filesystem.cxx index c9696dc..be4cad8 100644 --- a/build2/filesystem.cxx +++ b/build2/filesystem.cxx @@ -124,4 +124,18 @@ namespace build2 throw failed (); } } + + bool + empty (const dir_path& d) + { + try + { + return dir_empty (d); + } + catch (const system_error& e) + { + error << "unable to scan directory " << d << ": " << e.what (); + throw failed (); + } + } } -- cgit v1.1