|
|
@@ -23,6 +23,7 @@
|
|
|
#include "OSBasics.h"
|
|
|
#ifdef _WINDOWS
|
|
|
#include <windows.h>
|
|
|
+ #include <Shellapi.h>
|
|
|
#else
|
|
|
#include <dirent.h>
|
|
|
#include <sys/types.h>
|
|
|
@@ -339,6 +340,8 @@ vector<OSFileEntry> OSBasics::parseFolder(const String& pathString, bool showHid
|
|
|
|
|
|
void OSBasics::removeItem(const String& pathString) {
|
|
|
#ifdef _WINDOWS
|
|
|
+ String _tmp = pathString.replace("/", "\\");
|
|
|
+ DeleteFile(_tmp.getWDataWithEncoding(String::ENCODING_UTF8));
|
|
|
#else
|
|
|
remove(pathString.c_str());
|
|
|
#endif
|
|
|
@@ -346,6 +349,8 @@ void OSBasics::removeItem(const String& pathString) {
|
|
|
|
|
|
void OSBasics::createFolder(const String& pathString) {
|
|
|
#ifdef _WINDOWS
|
|
|
+ String path = pathString;
|
|
|
+ CreateDirectory(path.getWDataWithEncoding(String::ENCODING_UTF8), NULL);
|
|
|
#else
|
|
|
mkdir(pathString.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
|
|
|
#endif
|
|
|
@@ -354,6 +359,10 @@ void OSBasics::createFolder(const String& pathString) {
|
|
|
bool OSBasics::isFolder(const String& pathString) {
|
|
|
bool retVal = false;
|
|
|
#ifdef _WINDOWS
|
|
|
+ String path = pathString;
|
|
|
+ DWORD dwAttrib = GetFileAttributes(path.getWDataWithEncoding(String::ENCODING_UTF8));
|
|
|
+ return (dwAttrib != INVALID_FILE_ATTRIBUTES &&
|
|
|
+ (dwAttrib & FILE_ATTRIBUTE_DIRECTORY));
|
|
|
#else
|
|
|
DIR *d;
|
|
|
|