diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-11-04 08:51:26 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-11-04 09:26:34 +0200 |
commit | ebe762d3d6300dc9a5177b800876d5a65dbe996e (patch) | |
tree | 893bdf102bbbef58cb4358265aedf18528f8233d /build2/filesystem.cxx | |
parent | 3e0ec9b4d0dd5b02817c5f7a5ad48b55970dacbc (diff) |
Add empty(dir_path) to filesystem
Diffstat (limited to 'build2/filesystem.cxx')
-rw-r--r-- | build2/filesystem.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
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 (); + } + } } |