mirror of
https://github.com/jakcron/nstool.git
synced 2024-12-22 18:55:29 +00:00
Add makeDirectory() to fnd::io
This commit is contained in:
parent
886d51f63c
commit
45954d837d
|
@ -11,5 +11,6 @@ namespace fnd
|
|||
void readFile(const std::string& path, size_t offset, size_t len, MemoryBlob& blob);
|
||||
void writeFile(const std::string& path, const MemoryBlob& blob);
|
||||
void writeFile(const std::string& path, const byte_t* data, size_t len);
|
||||
void makeDirectory(const std::string& path);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
#include <fnd/io.h>
|
||||
#include <fstream>
|
||||
#ifdef _WIN32
|
||||
#include <direct.h>
|
||||
#else
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
|
||||
using namespace fnd;
|
||||
|
||||
|
@ -125,3 +130,12 @@ void io::writeFile(const std::string & path, const byte_t * data, size_t len)
|
|||
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
void io::makeDirectory(const std::string& path)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
_mkdir(path.c_str());
|
||||
#else
|
||||
mkdir(path.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
|
||||
#endif
|
||||
}
|
Loading…
Reference in a new issue