TF++, Miscellaneous classes and modules in C++:
mkdir.cc
Go to the documentation of this file.
1 
34 #define TF_MKDIR_CC_VERSION \
35  "TF_MKDIR_CC V1.0 "
36 
37 #include <tfxx/fs.h>
38 #include <sys/stat.h>
39 #include <errno.h>
40 
41 namespace tfxx {
42 
43  namespace fs {
44 
45  void mkdir(const std::string& path)
46  {
47  int status;
48  status=::mkdir(path.c_str(),
49  S_IRUSR | S_IWUSR | S_IXUSR |
50  S_IRGRP | S_IWGRP | S_IXGRP |
51  S_IROTH | S_IWOTH | S_IXOTH);
52  int errsv=errno;
53  if (status != 0)
54  {
55  throw tfxx::error::FSException("mkdir() failed",
56  __FILE__, __LINE__, errsv);
57  }
58  }
59 
60  } // namespace fs
61 
62 }
63 
64 /* ----- END OF mkdir.cc ----- */
exception class for file system utilities
Definition: fs.h:72
void mkdir(const std::string &path)
create a directory
Definition: mkdir.cc:45
Namespace containing all code of library libtfxx.