X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fstat.cpp;h=3bfae74c348dc2429b135efc189878514c56d518;hp=5a0ee45ba20fe92e029ad2aa5ab73d089fd3f71c;hb=a17d6ad286e19e2222ab8b6c9a762a83bf2c6c56;hpb=f91f1df3e0b00b3a270e571d4b2c8251da4d1226 diff --git a/source/stat.cpp b/source/stat.cpp index 5a0ee45..3bfae74 100644 --- a/source/stat.cpp +++ b/source/stat.cpp @@ -6,6 +6,9 @@ Distributed under the LGPL */ #include +#ifdef WIN32 +#include +#endif #include #include "path.h" #include "stat.h" @@ -31,6 +34,14 @@ bool exists(const Path &path) return access(path.str().c_str(), F_OK)==0; } +bool is_reg(const Path &path) +{ + struct stat st; + if(stat(path, st)==0) + return S_ISREG(st.st_mode); + return false; +} + bool is_dir(const Path &path) { struct stat st;