mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-06 05:48:40 +00:00
fix accidentally mistaking missing files for not missing, given new implementation of os_properties_from_file_path
This commit is contained in:
@@ -803,14 +803,15 @@ os_properties_from_file_path(String8 path)
|
|||||||
Temp scratch = scratch_begin(0, 0);
|
Temp scratch = scratch_begin(0, 0);
|
||||||
String16 path16 = str16_from_8(scratch.arena, path);
|
String16 path16 = str16_from_8(scratch.arena, path);
|
||||||
HANDLE handle = FindFirstFileW((WCHAR *)path16.str, &find_data);
|
HANDLE handle = FindFirstFileW((WCHAR *)path16.str, &find_data);
|
||||||
FindClose(handle);
|
|
||||||
FileProperties props = {0};
|
FileProperties props = {0};
|
||||||
|
if(handle != INVALID_HANDLE_VALUE)
|
||||||
{
|
{
|
||||||
props.size = Compose64Bit(find_data.nFileSizeHigh, find_data.nFileSizeLow);
|
props.size = Compose64Bit(find_data.nFileSizeHigh, find_data.nFileSizeLow);
|
||||||
w32_dense_time_from_file_time(&props.created, &find_data.ftCreationTime);
|
w32_dense_time_from_file_time(&props.created, &find_data.ftCreationTime);
|
||||||
w32_dense_time_from_file_time(&props.modified, &find_data.ftLastWriteTime);
|
w32_dense_time_from_file_time(&props.modified, &find_data.ftLastWriteTime);
|
||||||
props.flags = w32_file_property_flags_from_dwFileAttributes(find_data.dwFileAttributes);
|
props.flags = w32_file_property_flags_from_dwFileAttributes(find_data.dwFileAttributes);
|
||||||
}
|
}
|
||||||
|
FindClose(handle);
|
||||||
scratch_end(scratch);
|
scratch_end(scratch);
|
||||||
return props;
|
return props;
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-1
@@ -984,12 +984,15 @@ txti_mut_thread_entry_point(void *p)
|
|||||||
{
|
{
|
||||||
FileProperties pre_load_props = os_properties_from_file_path(msg->string);
|
FileProperties pre_load_props = os_properties_from_file_path(msg->string);
|
||||||
OS_Handle file = os_file_open(OS_AccessFlag_Read|OS_AccessFlag_ShareRead|OS_AccessFlag_ShareWrite, msg->string);
|
OS_Handle file = os_file_open(OS_AccessFlag_Read|OS_AccessFlag_ShareRead|OS_AccessFlag_ShareWrite, msg->string);
|
||||||
timestamp = pre_load_props.modified;
|
|
||||||
file_contents = os_string_from_file_range(scratch.arena, file, r1u64(0, pre_load_props.size));
|
file_contents = os_string_from_file_range(scratch.arena, file, r1u64(0, pre_load_props.size));
|
||||||
lang_kind = txti_lang_kind_from_extension(str8_skip_last_dot(msg->string));
|
lang_kind = txti_lang_kind_from_extension(str8_skip_last_dot(msg->string));
|
||||||
os_file_close(file);
|
os_file_close(file);
|
||||||
FileProperties post_load_props = os_properties_from_file_path(msg->string);
|
FileProperties post_load_props = os_properties_from_file_path(msg->string);
|
||||||
load_valid = (post_load_props.modified == pre_load_props.modified);
|
load_valid = (post_load_props.modified == pre_load_props.modified);
|
||||||
|
if(load_valid)
|
||||||
|
{
|
||||||
|
timestamp = pre_load_props.modified;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//- rjf: nonzero lang kind -> unpack lang info
|
//- rjf: nonzero lang kind -> unpack lang info
|
||||||
|
|||||||
Reference in New Issue
Block a user