Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os2.is_file not working #4389

Open
SrMordred opened this issue Oct 17, 2024 · 1 comment
Open

os2.is_file not working #4389

SrMordred opened this issue Oct 17, 2024 · 1 comment

Comments

@SrMordred
Copy link
Contributor

Context

os2.is_file are not working on windows

  • Operating System & Odin Version:
        Odin:    dev-2024-10-nightly:af9ae48
        OS:      Windows 11 Professional (version: 22H2), build 22621.4317
        CPU:     AMD Ryzen 5 1600 Six-Core Processor
        RAM:     16313 MiB
        Backend: LLVM 18.1.8

Expected Behavior

Same as os.is_file

Current Behavior

Unable to get the file type properly

this function gets the file type, but on

_file_type_mode_from_file_attributes :: proc(file_attributes: win32.DWORD, h: win32.HANDLE, ReparseTag: win32.DWORD) -> (type: File_Type, mode: int) {

the file handle are nil. Causing file_type to return .Undetermined.

type, mode := _file_type_mode_from_file_attributes(d.dwFileAttributes, nil, 0)

Since the file type that are compared here, it returns false for existing files.

return fi.type == .Regular

@flysand7
Copy link
Contributor

Uh oh, the git blame shows me as the culprit... I was messing around with type info and might have broken (did it work?) the stat. I'd have to think about this one before submitting a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants