1 #ifndef BLANK_IO_FILESYSTEM_HPP_
2 #define BLANK_IO_FILESYSTEM_HPP_
10 /// check if give path points to an existing directory
11 bool is_dir(const char *);
12 inline bool is_dir(const std::string &s) {
13 return is_dir(s.c_str());
15 /// check if give path points to an existing file
16 bool is_file(const char *);
17 inline bool is_file(const std::string &s) {
18 return is_file(s.c_str());
20 /// get timestamp of last modification
21 std::time_t file_mtime(const char *);
22 inline std::time_t file_mtime(const std::string &s) {
23 return file_mtime(s.c_str());
26 /// create given directory
27 /// @return true if the directory was created
28 /// the directory might already exist, see errno
29 bool make_dir(const char *);
30 inline bool make_dir(const std::string &s) {
31 return make_dir(s.c_str());
33 /// create given directory and all parents
34 /// @return true if the directory was created or already exists
35 bool make_dirs(const std::string &);