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

DirectorySelector fails to enumerate ~/Library/Application Support directories #6082

Open
ILW8 opened this issue Dec 21, 2023 · 0 comments · May be fixed by #6083
Open

DirectorySelector fails to enumerate ~/Library/Application Support directories #6082

ILW8 opened this issue Dec 21, 2023 · 0 comments · May be fixed by #6083

Comments

@ILW8
Copy link

ILW8 commented Dec 21, 2023

When attempting to click ~/Library/Application Support using the in-game file browser, the file browser flashes red and refuses to go into the directory.

It looks like while DirectorySelector.TryGetEntriesForPath is iterating over/sorting directory entries, the below exception is thrown and and caught. It is likely due to DirectoryInfo.GetDirectories attempting to pre-populate DirectoryInfo.

System.UnauthorizedAccessException: Access to the path '/Users/daohe/Library/Application Support/com.apple.LaunchServicesTemplateApp.dv' is denied.

protected virtual bool TryGetEntriesForPath(DirectoryInfo path, out ICollection<DirectorySelectorItem> items)
{
items = new List<DirectorySelectorItem>();
try
{
foreach (var dir in path.GetDirectories().OrderBy(d => d.Name))
{
if (ShowHiddenItems.Value || !dir.Attributes.HasFlagFast(FileAttributes.Hidden))
items.Add(CreateDirectoryItem(dir));
}
return true;
}
catch
{
return false;
}
}

Inaccessible directories in ~/Library/Application Support/ has also been a problem with JetBrains IDEs (e.g. this RIDER issue). According to this IDEA issue, ~/Library/Application Support/com.apple.LaunchServicesTemplateApp.dv is used by macOS Sonoma to support the new "Add to Dock" feature.

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

Successfully merging a pull request may close this issue.

2 participants