Repository navigation
Conversation
…sHidden Adds lime_system_get_windows_file_attributes, for CFFI and HashLink, which returns the FILE_ATTRIBUTE_* flags of a path from GetFileAttributesW, or -1 if there is no such file or this is not Windows. OpenFL's File.isHidden ran attrib in a new process for each call, which its TODO meant Lime to replace. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
OpenFL's
File.isHiddenrunsattribin a new process for each call onWindows, about 30 ms each on an idle machine. Its TODO says this should come
from Lime instead.
This adds
lime_system_get_windows_file_attributes(path), for CFFI andHashLink. It returns the
FILE_ATTRIBUTE_*flags of a file or directory fromGetFileAttributesW, or -1 if there is no such path or this is not Windows.System.__getWindowsFileAttributeswraps it for OpenFL, as__getDirectorydoes for its directories. The path goes to Windows in UTF-16: from
hxs_wcharon CFFI, and as the string's own bytes on HashLink.Test:
system.WindowsFileAttributesTestwrites a file and checks that it hasattributes but is not hidden, is hidden after
attrib +h, and has none oncedeleted. On cpp, the file name has a non-ASCII character. Neko's files take
their names in the ANSI code page, so there the name is ASCII. Elsewhere, the
test checks that the function returns -1.
It passes on a Windows VM in
lime test windows(MSVC) andlime test neko,on a Lime build with this change, and on Linux in
lime test linuxandlime test neko. HashLink was not run locally.