2016-10-19 21:28:06 +08:00
|
|
|
/*
|
|
|
|
ISC License
|
|
|
|
|
|
|
|
Copyright (c) 2016, Antonio SJ Musumeci <trapexit@spawn.link>
|
|
|
|
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
|
|
purpose with or without fee is hereby granted, provided that the above
|
|
|
|
copyright notice and this permission notice appear in all copies.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
|
|
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
|
|
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
|
|
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
|
|
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
|
|
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
|
|
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
2017-06-30 23:15:20 +08:00
|
|
|
#pragma once
|
2016-12-23 11:46:20 +08:00
|
|
|
|
2020-06-22 02:45:14 +08:00
|
|
|
#include "ghc/filesystem.hpp"
|
|
|
|
|
2016-10-19 21:28:06 +08:00
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
2020-12-20 04:06:08 +08:00
|
|
|
|
2016-10-19 21:28:06 +08:00
|
|
|
namespace fs
|
|
|
|
{
|
2020-06-22 02:45:14 +08:00
|
|
|
static
|
|
|
|
inline
|
|
|
|
int
|
|
|
|
mkdir(const char *path_,
|
|
|
|
const mode_t mode_)
|
|
|
|
{
|
|
|
|
return ::mkdir(path_,mode_);
|
|
|
|
}
|
|
|
|
|
2016-10-19 21:28:06 +08:00
|
|
|
static
|
|
|
|
inline
|
|
|
|
int
|
2019-01-25 20:03:46 +08:00
|
|
|
mkdir(const std::string &path_,
|
|
|
|
const mode_t mode_)
|
2016-10-19 21:28:06 +08:00
|
|
|
{
|
2020-06-22 02:45:14 +08:00
|
|
|
return fs::mkdir(path_.c_str(),mode_);
|
|
|
|
}
|
|
|
|
|
|
|
|
static
|
|
|
|
inline
|
|
|
|
int
|
|
|
|
mkdir(const ghc::filesystem::path &path_,
|
|
|
|
const mode_t mode_)
|
|
|
|
{
|
|
|
|
return fs::mkdir(path_.c_str(),mode_);
|
2016-10-19 21:28:06 +08:00
|
|
|
}
|
|
|
|
}
|