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

Consider use of System.IO.Enumeration #33

Open
danmoseley opened this issue Jul 27, 2018 · 10 comments
Open

Consider use of System.IO.Enumeration #33

danmoseley opened this issue Jul 27, 2018 · 10 comments
Milestone

Comments

@danmoseley
Copy link

In .NET Core 2.1 there's a "advanced" file system enumeration API
https://blogs.msdn.microsoft.com/jeremykuhne/2018/03/09/custom-directory-enumeration-in-net-core-2-1/ that is faster and more customizable.

Perhaps this would be interesting to use if available, especially since .NET Core itself does not yet have advanced globbing functionality.

@kthompson
Copy link
Owner

This seems like a good suggestion. I would be open to discussing an implementation/API for this and greatly appreciation any contributions.

@kthompson
Copy link
Owner

This seems interesting but until these APIs are available in .NET standard I don't think it make sense for this project at this time. Thanks

@danmoseley
Copy link
Author

Makes sense. It's expected in.NET Standard 2.1:
dotnet/standard#820

@kthompson
Copy link
Owner

kthompson commented Oct 28, 2018

I am subscribed to that PR 😄 I will keep an eye on it.

@kthompson kthompson reopened this Mar 11, 2020
@kthompson kthompson added this to the 2.0 milestone Mar 11, 2020
@kthompson
Copy link
Owner

kthompson commented Mar 11, 2020

@danmosemsft I was looking at the code for the System.IO.Enumeration APIs and I noticed that there are bits of code like:

#if MS_IO_REDIST
namespace Microsoft.IO.Enumeration
#else
namespace System.IO.Enumeration
#endif

As far as I can tell those allow usage from .NET Framework 4.7.2. Is that correct? If I wanted to use the file system enumeration API in .NET Framework 4.7.2 would I need to add a package for Microsoft.IO.Redist?

@danmoseley
Copy link
Author

I think so - looks like it's in nuget.
https://www.nuget.org/packages/Microsoft.IO.Redist

Since our focus is.NET Core if you found a bug that was specific to.NET Framework we might not be able to fix it, but it's open source and as far as I know it would work fine. @JeremyKuhne owns this - Jeremy any known issues with the package on.NET Framework?

@JeremyKuhne
Copy link

@kthompson No known issues. :) That package is specifically for 4.7.2. Let me know if you have any problems with it.

@kthompson
Copy link
Owner

@JeremyKuhne the only thing I noticed is that all of the FileSystemInfo, DirectoryInfo, and FileInfo seemed to be from another namespace as well. Something like Microsoft.IO.FileInfo iirc. Is that to be expected? I was looking at incorporating the use of System.IO.Enumeration but I wanted to keep support for .NET Framework as well but it seemed odd to me that those types have a different namespace rather than the same one from .NET Framework(making them effectively different types).

@JeremyKuhne
Copy link

@kthompson that is by design as they are different types. The library doesn't include everything in System.IO- the key thing it doesn't have is FileStream. FileStream on 4.7.2 will work with long paths and the like- you can either manifest and enable the reg key in Windows or simply prepend with \\?\ when creating FileStreams (after calling M.IO.Path.GetFullPath()).

@kthompson
Copy link
Owner

@JeremyKuhne Ok. I don't think it will be a major issue for users of this library on .NET Framework to use Microsoft.IO.Redist as there will be a couple breaking changes anyways. I will just need to make the ifdefs to use M.IO rather than System.IO for .NET Framework. Thanks for the feedback.

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

3 participants