* Handle errors getting state in Unix
Throwing errors while examining extended state while enumerating isn't consistent with Windows behavior. Windows never throws past getting directory entry data as all state is already available.
Ensure entry attribute state is consistent with initial construction.
* Win 7 CI machines are also setting NotContentIndexed.
Commit migrated from https://github.com/dotnet/corefx/commit/597f44c5056badfb47f45731480454d698849800
* Fix enumerating the root directory.
Shouldn't trim the trailing separator when at the root. On Windows that makes
the path drive relative- which breaks most of the logic.
Add a test to catch this case.
* Add the Unix part of the fix.
Commit migrated from https://github.com/dotnet/corefx/commit/5b4ce203c563a20053f32f9901ea6b7dc67c8e37
NtCreateFile allows passing in a base handle which makes opening child directories much faster. This cuts anywhere from 3-10% of the time off of a GetFiles() call.
It is significantly faster as it avoids normalization and path parsing overhead.
Commit migrated from https://github.com/dotnet/corefx/commit/a28a2cdda67c024126f690bbe1331174a194f9ce
* Clear initlocals in a bunch of assemblies
Sets
```XML
<ILLinkClearInitLocals>true</ILLinkClearInitLocals>
```
for the assemblies:
- System.IO.FileSystem
- System.IO.Pipes
- System.Memory
- System.Net.Http
- System.Net.Http.WinHttpHandler
- System.Net.NameResolution
- System.Net.NetworkInformation
- System.Net.Primitives
- System.Net.Requests
- System.Net.Security
- System.Net.Sockets
- System.Net.WebSockets
- System.Net.WebSockets.Client
- System.Net.WebSockets.WebSocketsProtocol
- System.Private.Uri
- System.Runtime
- System.Runtime.Extensions
Eventually we'd ideally set the flag for the whole repo; these are just the ones I audited thus far. In a few cases I had to make code changes to adapt, where the code was expecting stackallocs to be cleared. I also looked at a few other projects (System.Collections, System.Runtime.Numerics) where there were more significant dependencies on clearing and I decided to leave those for later.
* Disable ILLinkClearInitLocals running on Unix until it works there
Commit migrated from https://github.com/dotnet/corefx/commit/f0a032e4a1c8a848574a5db3e69e8a6fa0aae91e
* Reduce Unix enumeration allocations
This change factors out the FileStatus access into a helper struct and adds overloads
for the stat imports that allow passing a span.
The next steps:
- Handle errors manually
- Skip using safehandle
- Look for further opportunities around UTF-8/16 conversion
* Address feedback
Shuffle code around a bit in FileInfo for clarity. Also shift directory determination
to FileSystemEntry to avoid allocation on links.
Commit migrated from https://github.com/dotnet/corefx/commit/c64171e379090b372fe232ec3f27a57ae838406c
* Fix accessing trimmed paths
Paths with trailing spaces or periods are normally trimmed by Windows. They can, however, be created using `\\?\` or be exposed via mapping of remote file systems. This change fixes the ability to work with returned *Info classes on files of this type.
This change also cleans up the Info classes:
- removes non-relevant comments
- removes "display" paths (limited trust holdover)
Also remove dead PathPair class.
* Fix helper for .NET Standard
Commit migrated from https://github.com/dotnet/corefx/commit/e2cd5a8fc468b63255f91f4f28bccddb3bb31e8f
* Windows file enumeration extensibility
This is the Windows implementation of System.IO.Enumeration. It adds
new find options to existing APIs and a public extensibilty model
for richer, low allocation file system enumeration.
The Unix implementation is in progress.
* Initial naive Unix implementation of FileSystemEnumerator
* Move a netcoreapp test to the right group
* Fix WinRT build.
* Address feedback from @danmosemsft
* Remove inline attribute
* Remove IsNameDotOrDotDot property
* Address futher feedback.
* Remove unreferenced common code
Commit migrated from https://github.com/dotnet/corefx/commit/66ada723c1b0ae9062a0e7b0b28862014b985019
* Update PAL
* Revert PAL
* Add SxS struct
* Test
* CompareTo
* Simple creation time test
* CompareTo public
* Simple creation time test
* typo
* Extract method
* CR feedback
* Look for birthtimespec
* Rework to PAL approach
* comment
* typos
* typo
* Comment
Commit migrated from https://github.com/dotnet/corefx/commit/d75610efce77c2f2562c4f35de901ea38b6d43b7
* Fast file enumeration for Windows
Implements an optimized, low allocation replacement for file enumeration on Windows. In preliminary tests this improves performance at least two fold, particularly for recursive searches.
Removes aggressive filter validation.
Copies and cleans up filename matching code from FileSystemWatcher.
Add length setter for ValueStringBuilder.
Remove Unix .. check for enumerable.
Commit migrated from https://github.com/dotnet/corefx/commit/eb0d4388c339288a589bdd7f5e0c9fcd61da4362
* Clean up CreateFile usage.
The "safe" create file was specifically targetted at FileStream and doesn't apply to remaining usages in FileSystem.
Also collapse a few unnecessary methods.
* Missed a file.
* Related UAP changes
* Remove unnecessary qualifiers.
Commit migrated from https://github.com/dotnet/corefx/commit/c3abf82d27ae168cfdb5965bb1a28185800a22ca