Setting window sizes, NewDir
This commit is contained in:
@@ -276,6 +276,31 @@ int64_t GetFileModTime(String file) {
|
||||
}
|
||||
}
|
||||
|
||||
enum MakeDirResult {
|
||||
MakeDirResult_Success,
|
||||
MakeDirResult_Exists,
|
||||
MakeDirResult_NotFound,
|
||||
MakeDirResult_ErrorOther,
|
||||
};
|
||||
|
||||
MakeDirResult MakeDir(String path) {
|
||||
Scratch scratch;
|
||||
MakeDirResult result = MakeDirResult_Success;
|
||||
String16 string16 = ToString16(scratch, path);
|
||||
BOOL success = CreateDirectoryW((wchar_t *)string16.data, NULL);
|
||||
if (success == 0) {
|
||||
DWORD error = GetLastError();
|
||||
if (error == ERROR_ALREADY_EXISTS) {
|
||||
result = MakeDirResult_Exists;
|
||||
} else if (error == ERROR_PATH_NOT_FOUND) {
|
||||
result = MakeDirResult_NotFound;
|
||||
} else {
|
||||
result = MakeDirResult_ErrorOther;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
struct Win32Process {
|
||||
HANDLE handle;
|
||||
HANDLE child_stdout_read;
|
||||
|
||||
Reference in New Issue
Block a user