Draft: Identify macOS UNIX-specific system directories#18
Open
jakewilliami wants to merge 11 commits intomasterfrom
Open
Draft: Identify macOS UNIX-specific system directories#18jakewilliami wants to merge 11 commits intomasterfrom
jakewilliami wants to merge 11 commits intomasterfrom
Conversation
Getting back to the task of checking whether a directory is a _system_ directory, I reviewed an old link I posted in #1: https://stackoverflow.com/a/1140345/12069968. While a lot of these function appear to be deprecated now, it seems to work somewhat well. For example, `_isinvisible_alt` returns `true` on all UNIX-specific directories listed in the macOS resources for this type of hidden file. We still need to: - Implement tests for all of these UNIX-specific directories; - Find non-deprecated system calls to obtain the same information; - Correctly construct LSItemInfoRecord (rather than allocating a reasonably large buffer because I don't know how large it needs to be), and find the correct offset for flags. Addresses #1 Ref: #1 (comment) ``` julia> HiddenFiles._isinvisible_alt("/bin") true julia> HiddenFiles._isinvisible_alt("/dev/") true julia> HiddenFiles._isinvisible_alt("/dev") true julia> HiddenFiles._isinvisible_alt("/etc") true julia> HiddenFiles._isinvisible_alt("/sbin/") true julia> HiddenFiles._isinvisible_alt("/sbin") true julia> HiddenFiles._isinvisible_alt("/tmp") true julia> HiddenFiles._isinvisible_alt("/usr") true julia> HiddenFiles._isinvisible_alt("/var") true ```
Moved _isinvisible_alt to main module file, and renamed to _isinvisible_macos_item_info, and corrected tests accordingly. Currently tests are failing because `realpath` expands some directories (e.g., `/tmp`) to `/private/tmp`. I should perhaps use `normpath` instead of `realpath`.
c82f365 to
3c1e657
Compare
Accidentally made it the same value as (the deprecated) value KLS_ITEM_INFO_IS_INVISIBLE.
I think this package came out in 2014
6f46bde - initial empty commit (Wed 15 Oct 2014) <@MikeInnes>
But it wasn't working on Julia till Tim picked it up in 2024
91eda41 - Replace REQUIRE with Project.toml. (Tue 28 Feb 2023) <@maleadt>
Which is *after* my initial work on HiddenFiles.jl
243ee48 - Initial commit (Wed 24 Aug 2022) <@jakewilliami>
I think its current state would be easier to work with.
See #8
2fa8498 to
56ed7d6
Compare
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.
According to this, there as some UNIX-specific system directories that exist as part of the BSD-layer which are important and hidden by default. We need some way of identifying these.
Addresses #1.
Related question.
TODO:
LSItemInfoRecordstruct properlyrealpathvsnormpath(ref) (edit 2025: has this been resolved byPathStruct?)