Reopen changed files
This commit is contained in:
@@ -26,13 +26,14 @@ void Advance(FileIter *it);
|
||||
FileIter IterateFiles(Allocator allocator, String path);
|
||||
void InitOS(void (*error_proc)(const char *, ...));
|
||||
|
||||
String GetExePath(Allocator allocator);
|
||||
String GetExeDir(Allocator allocator);
|
||||
bool FileExists(String path);
|
||||
bool IsDir(String path);
|
||||
bool IsFile(String path);
|
||||
String GetWorkingDir(Allocator arena);
|
||||
bool IsAbsolute(String path);
|
||||
String GetExePath(Allocator allocator);
|
||||
String GetExeDir(Allocator allocator);
|
||||
bool FileExists(String path);
|
||||
bool IsDir(String path);
|
||||
bool IsFile(String path);
|
||||
String GetWorkingDir(Allocator arena);
|
||||
bool IsAbsolute(String path);
|
||||
int64_t GetFileModTime(String file);
|
||||
|
||||
struct Process {
|
||||
bool is_valid;
|
||||
|
||||
@@ -262,6 +262,21 @@ bool DeleteFile(String path) {
|
||||
return result;
|
||||
}
|
||||
|
||||
int64_t GetFileModTime(String file) {
|
||||
Scratch scratch;
|
||||
String16 string16 = ToString16(scratch, file);
|
||||
WIN32_FIND_DATAW data;
|
||||
HANDLE handle = FindFirstFileW(string16.data, &data);
|
||||
if (handle != INVALID_HANDLE_VALUE) {
|
||||
FindClose(handle);
|
||||
FILETIME time = data.ftLastWriteTime;
|
||||
int64_t result = (int64_t)time.dwHighDateTime << 32 | time.dwLowDateTime;
|
||||
return result;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
struct Win32Process {
|
||||
HANDLE handle;
|
||||
HANDLE child_stdout_read;
|
||||
|
||||
Reference in New Issue
Block a user