59 char buf[MAX_PATH] =
"";
60 _fullpath(buf,relname.c_str(),MAX_PATH);
66 char buf[MAX_PATH] =
"";
67 GetCurrentDirectory(MAX_PATH,buf);
73 return ((!pathname.empty() && pathname[0] ==
'\\') ||
74 (pathname.length() >= 3 && pathname[1] ==
':' &&
75 pathname[2] ==
'\\'));
80 WIN32_FILE_ATTRIBUTE_DATA obj_info;
81 int res = GetFileAttributesEx(name.c_str(),GetFileExInfoStandard,&obj_info);
83 if (obj_info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
99 for (
int element = 0; !result && element < elements;) {
100 result = _mkdir(
path.
segment(0,++element).c_str());
101 result *= errno != EEXIST;
105 result = _mkdir(abs_path.c_str());
106 result *= errno != EEXIST;
unsigned obj_type_t
Abstract type of filesystem object types.
permissions get_permissions(std::string const &filename)
void make_dir(std::string const &abs_path, bool recursive=true)
Create a directory given an absolute path name.
std::string segment(size_t start=0, size_t len=std::string::npos) const
Get a sub-sequence of the path's elements as a string.
bool is_absolute(std::string pathname)
Say whether a filename is absolute or relative.
abend_msg< 16 > abend_cant_create_dir
Report can't create directory.
std::string cwd()
Get the absolute real pathname of the current working directory.
chew_mode::name const name
An exemplar chew_mode::name
The tag class is inserted in a diagnostic_base to tell it to emit itself.
size_t elements() const
Get the number of elements in the path
int set_permissions(std::string const &filename, permissions p)
std::string abs_path(std::string const &filename)
Get the absolute pathname for a filename.
std::string real_path(std::string const &relname)
Get the absolute real pathname of a file or directory name.
obj_type_t obj_type(std::string const &name)
Get the type of the object putatively designated by a filename.
int permissions
Type of file permissions mask.
string system_error_message(unsigned errnum)
Get the system error message for a system error number.