Reopen changed files

This commit is contained in:
Krzosa Karol
2024-08-14 07:35:12 +02:00
parent f125a38c50
commit 2b4a43ddc1
9 changed files with 80 additions and 22 deletions

View File

@@ -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;