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

Check if Windows implementation is correct #11

Open
jakewilliami opened this issue Sep 1, 2022 · 4 comments
Open

Check if Windows implementation is correct #11

jakewilliami opened this issue Sep 1, 2022 · 4 comments
Labels
question Further information is requested Windows

Comments

@jakewilliami
Copy link
Owner

Despite finding resources to calculate the Windows implementation of is_hidden, I have found resources that may indicate we do not need to check for the existence of FILE_ATTRIBUTE_SYSTEM in the file's attributes.[1], [2] We should investigate this to make sure the way we do it is correct.

@jakewilliami jakewilliami added question Further information is requested Windows labels Sep 1, 2022
jakewilliami added a commit that referenced this issue Sep 1, 2022
@jakewilliami
Copy link
Owner Author

jakewilliami commented Sep 1, 2022

Um...GetFileAttributesA!=GetFileAttributesW?

EDIT: Oh, I think it's okay:

GetFileAttributesA:
DWORD GetFileAttributesA(
  [in] LPCSTR lpFileName
);
GetFileAttributesW:
DWORD GetFileAttributesW(
  [in] LPCWSTR lpFileName
);

So they take different input types.

LPCSTR

An LPCSTR is a 32-bit pointer to a constant null-terminated string of 8-bit Windows (ANSI) characters.

LPCWSTR

An LPCWSTR is a 32-bit pointer to a constant string of 16-bit Unicode characters, which MAY be null-terminated.

So probably in the interest of non-ANSI path names we should use GetFileAttributesW, despite possible performance considerations.

@jakewilliami
Copy link
Owner Author

I'm really not sure we do need to check for FILE_ATTRIBUTE_SYSTEM. The description of the flag is

A file or directory that the operating system uses a part of, or uses exclusively.

Surely that doesn't make it hidden? I need to test on a Windows machine by viewing it in explorer.exe or by using dir to see if it's displayed.

@jakewilliami
Copy link
Owner Author

jakewilliami commented Sep 23, 2022

Regarding the above (#11 (comment)), I've asked a question on this thread.

@jakewilliami
Copy link
Owner Author

See this implementation for inspiration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested Windows
Projects
None yet
Development

No branches or pull requests

1 participant