|
@@ -16,28 +16,25 @@ find_data_to_file_info :: proc(base_path: string, d: ^win32.WIN32_FIND_DATAW, al
|
|
|
}
|
|
|
path := concatenate({base_path, `\`, win32_utf16_to_utf8(d.cFileName[:], temp_allocator()) or_else ""}, allocator) or_return
|
|
|
|
|
|
+ handle := win32.HANDLE(_open_internal(path, {.Read}, 0o666) or_else 0)
|
|
|
+ defer win32.CloseHandle(handle)
|
|
|
|
|
|
fi.fullpath = path
|
|
|
fi.name = basename(path)
|
|
|
fi.size = i64(d.nFileSizeHigh)<<32 + i64(d.nFileSizeLow)
|
|
|
|
|
|
- fi.type, fi.mode = _file_type_mode_from_file_attributes(d.dwFileAttributes, nil, d.dwReserved0)
|
|
|
+ fi.type, fi.mode = _file_type_mode_from_file_attributes(d.dwFileAttributes, handle, d.dwReserved0)
|
|
|
|
|
|
fi.creation_time = time.unix(0, win32.FILETIME_as_unix_nanoseconds(d.ftCreationTime))
|
|
|
fi.modification_time = time.unix(0, win32.FILETIME_as_unix_nanoseconds(d.ftLastWriteTime))
|
|
|
fi.access_time = time.unix(0, win32.FILETIME_as_unix_nanoseconds(d.ftLastAccessTime))
|
|
|
|
|
|
-
|
|
|
- handle := win32.HANDLE(_open_internal(path, {.Read}, 0o666) or_else 0)
|
|
|
- defer win32.CloseHandle(handle)
|
|
|
-
|
|
|
if file_id_info: win32.FILE_ID_INFO; handle != nil && win32.GetFileInformationByHandleEx(handle, .FileIdInfo, &file_id_info, size_of(file_id_info)) {
|
|
|
#assert(size_of(fi.inode) == size_of(file_id_info.FileId))
|
|
|
#assert(size_of(fi.inode) == 16)
|
|
|
runtime.mem_copy_non_overlapping(&fi.inode, &file_id_info.FileId, 16)
|
|
|
}
|
|
|
|
|
|
-
|
|
|
return
|
|
|
}
|
|
|
|