From: Mikko Rasa Date: Sun, 15 Jul 2012 12:05:32 +0000 (+0300) Subject: Do less syscalls in mkpath X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=c8af8a2167685dc52c6e77951f3fa6ee53d67654;p=libs%2Fcore.git Do less syscalls in mkpath --- diff --git a/source/fs/dir.cpp b/source/fs/dir.cpp index ea0cd95..f7f34f6 100644 --- a/source/fs/dir.cpp +++ b/source/fs/dir.cpp @@ -84,9 +84,9 @@ void mkpath(const Path &path, int mode) if(p.size()==1 && p.is_absolute()) continue; #endif - if(exists(p)) + if(FS::Stat st = stat(p)) { - if(!is_dir(p)) + if(!st.is_directory()) throw not_a_directory(p); continue; }