mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-02 11:01:10 +00:00
Fixes hidden detection for directory paths with trailing separators.
This commit is contained in:
1 parent
b46dce745b
commit
7f4c8cc8b9
2 files changed
+19
-1
No files matched your search
+3
-1
@@ -62,7 +62,9 @@ internal class DirectoryProviderService : IDirectoryProviderService
|
||||
// The hidden flag is metadata, so it follows the same read properties permission as the other metadata accessors.
|
||||
if (!_fileSystemPermissionsService.CanAccessPath(path, FileAccessMode.ReadProperties, false))
|
||||
return false;
|
||||
return (GetAttributes(path.Path) & FileAttributes.Hidden) == FileAttributes.Hidden;
|
||||
// Child directory paths carry a trailing separator, which prevents the Unix file system from reporting the dot-prefixed hidden entry.
|
||||
string directoryPath = path.Path.EndsWith(_fileSystem.Path.DirectorySeparatorChar) ? path.Path[..^1] : path.Path;
|
||||
return (GetAttributes(directoryPath) & FileAttributes.Hidden) == FileAttributes.Hidden;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in new issue
Block a user