From 039f62b48a14fefabae07d8c008e2e131deadfc6 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 28 Aug 2016 11:03:00 +0200 Subject: Add few filesystem function overloads for C-string paths --- butl/filesystem.cxx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'butl/filesystem.cxx') diff --git a/butl/filesystem.cxx b/butl/filesystem.cxx index 9db8814..5584e00 100644 --- a/butl/filesystem.cxx +++ b/butl/filesystem.cxx @@ -35,14 +35,14 @@ using namespace std; namespace butl { bool - file_exists (const path& p) + file_exists (const char* p) { #ifndef _WIN32 struct stat s; - if (stat (p.string ().c_str (), &s) != 0) + if (stat (p, &s) != 0) #else struct _stat s; - if (_stat (p.string ().c_str (), &s) != 0) + if (_stat (p, &s) != 0) #endif { if (errno == ENOENT || errno == ENOTDIR) @@ -55,14 +55,14 @@ namespace butl } bool - dir_exists (const path& p) + dir_exists (const char* p) { #ifndef _WIN32 struct stat s; - if (stat (p.string ().c_str (), &s) != 0) + if (stat (p, &s) != 0) #else struct _stat s; - if (_stat (p.string ().c_str (), &s) != 0) + if (_stat (p, &s) != 0) #endif { if (errno == ENOENT || errno == ENOTDIR) @@ -294,14 +294,14 @@ namespace butl nsec (...) {return 0;} timestamp - file_mtime (const path& p) + file_mtime (const char* p) { #ifndef _WIN32 struct stat s; - if (stat (p.string ().c_str (), &s) != 0) + if (stat (p, &s) != 0) #else struct _stat s; - if (_stat (p.string ().c_str (), &s) != 0) + if (_stat (p, &s) != 0) #endif { if (errno == ENOENT || errno == ENOTDIR) -- cgit v1.1