forked from AUTOMATIC1111/IntoTheBreachLua
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathos.cc
More file actions
38 lines (27 loc) · 683 Bytes
/
Copy pathos.cc
File metadata and controls
38 lines (27 loc) · 683 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include "os.h"
#include "utils.h"
#include <shlobj.h>
#pragma comment(lib, "shell32.lib")
namespace OS {
std::string getKnownFolder(int csild) {
char folder[MAX_PATH];
HRESULT result = SHGetFolderPathA(NULL, csild, NULL, SHGFP_TYPE_CURRENT, folder);
if(result != S_OK)
return "";
return folder;
}
void log(const std::string & line) {
::log("%s\n", line.c_str());
}
bool isshiftdown() {
return (GetAsyncKeyState(VK_SHIFT) & 0x8000) == 0x8000;
}
double mtime(const std::string filename) {
struct stat st = { 0 };
stat(filename.c_str(), &st);
return (double) st.st_mtime;
}
void mkdir(std::string path) {
SHCreateDirectoryEx(NULL, s2ws(path).c_str(), NULL);
}
}