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

AggregateFileSystem can list duplicate entries #27

Closed
Rohansi opened this issue May 2, 2018 · 2 comments
Closed

AggregateFileSystem can list duplicate entries #27

Rohansi opened this issue May 2, 2018 · 2 comments

Comments

@Rohansi
Copy link
Contributor

Rohansi commented May 2, 2018

If more than one filesystem has the same entry at a path the aggregate will list both. I don't consider this desirable because there would be no way to access the duplicate entries except through the original filesystem. Although it's possible and I'm sure someone will have a strange use for it this behavior is inconsistent with how normal file operations work on it.

The filesystem watcher is probably affected as well because it would need to check if a filesystem with higher priority also contains an entry for the path referenced by the event.

@xoofx
Copy link
Owner

xoofx commented May 3, 2018

If more than one filesystem has the same entry at a path the aggregate will list both.

Really? Then that's a bug... I thought I covered originally this case... The code supposed to do this is there, maybe there is an obvious oversight:

if (!entries.Contains(item))
{
var isFile = fileSystem.FileExists(item);
var isDirectory = fileSystem.DirectoryExists(item);
var isMatching = search.Match(item);
if (isMatching && ((isFile && searchTarget != SearchTarget.Directory) || (isDirectory && searchTarget != SearchTarget.File)))
{
entries.Add(item);
}
if (searchOption == SearchOption.AllDirectories && isDirectory)
{
sortedDirectories.Add(item);
}
}

@Rohansi
Copy link
Contributor Author

Rohansi commented May 3, 2018

Sorry, it looks like this was just an issue on my end.

@Rohansi Rohansi closed this as completed May 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants