aboutsummaryrefslogtreecommitdiff
path: root/butl/filesystem
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-08-19 18:10:12 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-08-19 18:10:12 +0200
commit6aada88dc77a95a7b2726c39e008d4ddcd38d58c (patch)
tree12206f32a4f650860bfccc596c1607e5fb19e0c2 /butl/filesystem
parent2676fc8d88af82dff1033869823b435d9b91c9b8 (diff)
Add dir_empty() test
Diffstat (limited to 'butl/filesystem')
-rw-r--r--butl/filesystem12
1 files changed, 9 insertions, 3 deletions
diff --git a/butl/filesystem b/butl/filesystem
index 118fa01..41b9266 100644
--- a/butl/filesystem
+++ b/butl/filesystem
@@ -32,17 +32,23 @@
namespace butl
{
+ // Return true if the path is to an existing regular file. Note that
+ // this function resolves symlinks.
+ //
+ LIBBUTL_EXPORT bool
+ file_exists (const path&);
+
// Return true if the path is to an existing directory. Note that
// this function resolves symlinks.
//
LIBBUTL_EXPORT bool
dir_exists (const path&);
- // Return true if the path is to an existing regular file. Note that
- // this function resolves symlinks.
+ // Return true if the directory is empty. Note that the path must exist
+ // and be a directory.
//
LIBBUTL_EXPORT bool
- file_exists (const path&);
+ dir_empty (const dir_path&);
// Try to create a directory unless it already exists. If you expect
// the directory to exist and performance is important, then you