moved os_folder_exists to the main layer and deleted win32 layer from linker folder

This commit is contained in:
Nikita Smith
2024-11-07 13:55:15 -08:00
parent ef5287d2a9
commit daeb08e79f
4 changed files with 12 additions and 104 deletions
+1
View File
@@ -210,6 +210,7 @@ internal B32 os_delete_file_at_path(String8 path);
internal B32 os_copy_file_path(String8 dst, String8 src);
internal String8 os_full_path_from_path(Arena *arena, String8 path);
internal B32 os_file_path_exists(String8 path);
internal B32 os_folder_path_exists(String8 path);
internal FileProperties os_properties_from_file_path(String8 path);
//- rjf: file maps
+11
View File
@@ -521,6 +521,17 @@ os_file_path_exists(String8 path)
return exists;
}
internal B32
os_folder_path_exists(String8 path)
{
Temp scratch = scratch_begin(0,0);
String16 path16 = str16_from_8(scratch.arena, path);
DWORD attributes = GetFileAttributesW((WCHAR *)path16.str);
B32 exists = (attributes != INVALID_FILE_ATTRIBUTES) && (attributes & FILE_ATTRIBUTE_DIRECTORY);
scratch_end(scratch);
return exists;
}
internal FileProperties
os_properties_from_file_path(String8 path)
{