From 6aada88dc77a95a7b2726c39e008d4ddcd38d58c Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 19 Aug 2016 18:10:12 +0200 Subject: Add dir_empty() test --- butl/filesystem.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'butl/filesystem.cxx') 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 -- cgit v1.1