diff -r ca99a81745fe -r 1dee2330aa78 src/Platform-Posix.cpp --- a/src/Platform-Posix.cpp Tue Jan 01 15:34:07 2013 -0800 +++ b/src/Platform-Posix.cpp Tue Jan 01 16:28:34 2013 -0800 @@ -17,6 +17,7 @@ * JITCraft. If not, see http://www.gnu.org/licenses/. */ #include +#include #include #include #include @@ -154,3 +155,19 @@ return "/"; } +OS::PathType +OS::InspectPath(const char *path) +{ + struct stat s; + int result = stat(path, &s); + if (result != 0) + return OS::Path_Invalid; + + if (s.st_mode & S_IFDIR) + return OS::Path_Folder; + if (s.st_mode & S_IFREG) + return OS::Path_File; + + return OS::Path_Invalid; +} +