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

System.IO: Allow recursive file system enumeration to continue when directory link's target does not exist #58612

Open
Tracked by #57205 ...
fitdev opened this issue Sep 3, 2021 · 2 comments
Milestone

Comments

@fitdev
Copy link

fitdev commented Sep 3, 2021

Perhaps this should be considered holistically as part of .Net 7's improved and more integrated support of file system links into various APIs, but at the least it would be nice to add:

public class EnumerationOptions {

  public bool IgnoreUnresolvableLinkTargets { get; set; } // when false preserves current (DotNet 6) behavior, i.e. throws DirectoryNotFoundException when target cannot be found

}

to prevent throwing of DirectoryNotFoundException when a symlink / junction is encountered during enumeration which has invalid (non-existing) target, as often it is valuable to continue enumeration regardless, plus it will parallel existing IgnoreInaccessible option.

@dotnet-issue-labeler dotnet-issue-labeler bot added area-System.IO untriaged New issue has not been triaged by the area owner labels Sep 3, 2021
@ghost
Copy link

ghost commented Sep 3, 2021

Tagging subscribers to this area: @dotnet/area-system-io
See info in area-owners.md if you want to be subscribed.

Issue Details

Perhaps this should be considered holistically as part of .Net 7's improved and more integrated support of file system links into various APIs, but at the least it would be nice to add:

public class EnumerationOptions {

  public bool IgnoreUnresolvableLinkTargets { get; set; } // when false preserves current (DotNet 6) behavior, i.e. throws DirectoryNotFoundException when target cannot be found

}

to prevent throwing of DirectoryNotFoundException when a symlink / junction is encountered during enumeration which has invalid (non-existing) target, as often it is valuable to continue enumeration regardless, plus it will parallel existing IgnoreInaccessible option.

Author: fitdev
Assignees: -
Labels:

area-System.IO, untriaged

Milestone: -

@iSazonov
Copy link
Contributor

iSazonov commented Sep 4, 2021

I'd qualify this as a bug and re-use EnumerationOptions.IgnoreInaccessible to mask the exception.

/cc @carlossanlop @jozkee

@jozkee jozkee removed the untriaged New issue has not been triaged by the area owner label Sep 10, 2021
@jozkee jozkee added this to the 7.0.0 milestone Sep 10, 2021
@jeffhandley jeffhandley modified the milestones: 7.0.0, Future Jul 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants