3 This file is part of libmspfs
4 Copyright © 2006-2008 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
12 #include <msp/core/except.h>
19 int stat(const Path &fn, struct stat &st)
21 return ::stat(fn.str().c_str(), &st);
24 struct stat stat(const Path &fn)
28 throw SystemError("stat failed", errno);
32 bool exists(const Path &path)
34 return access(path.str().c_str(), F_OK)==0;
37 bool is_reg(const Path &path)
41 return S_ISREG(st.st_mode);
45 bool is_dir(const Path &path)
49 return S_ISDIR(st.st_mode);