Change to Permissions bit_set from relying on octal numbering for os2

This commit is contained in:
gingerBill
2025-10-31 14:45:53 +00:00
parent d374dc3c99
commit b9df67f8c5
14 changed files with 88 additions and 44 deletions
+4 -4
View File
@@ -211,11 +211,11 @@ _file_type_from_create_file :: proc(wname: win32.wstring, create_file_attributes
return file_type(h)
}
_file_type_mode_from_file_attributes :: proc(file_attributes: win32.DWORD, h: win32.HANDLE, ReparseTag: win32.DWORD) -> (type: File_Type, mode: int) {
_file_type_mode_from_file_attributes :: proc(file_attributes: win32.DWORD, h: win32.HANDLE, ReparseTag: win32.DWORD) -> (type: File_Type, mode: Permissions) {
if file_attributes & win32.FILE_ATTRIBUTE_READONLY != 0 {
mode |= 0o444
mode += Permissions_Write_All
} else {
mode |= 0o666
mode += Permissions_Read_Write_All
}
is_sym := false
@@ -229,7 +229,7 @@ _file_type_mode_from_file_attributes :: proc(file_attributes: win32.DWORD, h: wi
type = .Symlink
} else if file_attributes & win32.FILE_ATTRIBUTE_DIRECTORY != 0 {
type = .Directory
mode |= 0o111
mode += Permissions_Execute_All
} else if h != nil {
type = file_type(h)
}