aboutsummaryrefslogtreecommitdiff
path: root/butl/filesystem.cxx
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.cxx
parent2676fc8d88af82dff1033869823b435d9b91c9b8 (diff)
Add dir_empty() test
Diffstat (limited to 'butl/filesystem.cxx')
-rw-r--r--butl/filesystem.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/butl/filesystem.cxx b/butl/filesystem.cxx
index e5819e2..a807f4c 100644
--- a/butl/filesystem.cxx
+++ b/butl/filesystem.cxx
@@ -35,7 +35,7 @@ using namespace std;
namespace butl
{
bool
- dir_exists (const path& p)
+ file_exists (const path& p)
{
#ifndef _WIN32
struct stat s;
@@ -51,11 +51,11 @@ namespace butl
throw system_error (errno, system_category ());
}
- return S_ISDIR (s.st_mode);
+ return S_ISREG (s.st_mode);
}
bool
- file_exists (const path& p)
+ dir_exists (const path& p)
{
#ifndef _WIN32
struct stat s;
@@ -71,7 +71,7 @@ namespace butl
throw system_error (errno, system_category ());
}
- return S_ISREG (s.st_mode);
+ return S_ISDIR (s.st_mode);
}
mkdir_status