* 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
* Add tests to validate we don't fall over enumerating files that just cross the legacy MAX_PATH barrier. As we do special logic on Windows to support long paths this is an important boundary to test. While these path lengths don't have special meaning outside of Windows, we'll always run them they should still pass .
* Conditionalize tests for long path support
NetFX needs to have the long path functionality enabled to run these
tests.
Commit migrated from https://github.com/dotnet/corefx/commit/424823b9123729ec990b31666177b6b17905eb1c
* Use FromApp APIs to allow brokered file access
This changes our P/Invokes to use the FromApp variants, which
allow for brokered file access on UAP. These are only included
in the UAP build.
Adds tests for the brokered IO WinRT functions and removes a
dead option from movefile. This option was removed in Windows 8
and did not work correctly in prior OSes. (This was needed
for this change.)
This change depends on the referenced dll being packaged and
added to our dependencies. There is a related change for CoreCLR
that supports FileStream.
* Address feedback.
* Remove unused define.
* Test tweaks
* Add ActiveIssue to known test failure
Unsetting attribute after setting isn't working (only in brokered
locations). A fix to FileApiInterop.dll is in the works.
* Disable other attributes test.
Commit migrated from https://github.com/dotnet/corefx/commit/5e16d10c41536446f7be2299c61cdc85992966c0
* Moving PlatformDetection to Corefx.Private.TestUtilities assembly
The purpose of this change is to clean up all test projects instead of including the PlatformDetection code inside every test project, we’ll have it in the Corefx.Private.TestUtilities.
I have refactored the PlatformDetection to split the different implementation of Windows and Linux. If we need to do more refactoring there we can do it later as needed.
* Fix Linux BB
* Update the xunit package reference
* Fix wrong condition on one of the tests
* Update the ConditionalFact/Theory to use Type as a parameter
Commit migrated from https://github.com/dotnet/corefx/commit/878e2fcf5a9f1068015e5fada9231088663e3490
* Improve directory deletion stack pressure
Recursive directory deletion used particulary large frames and would easily stack overflow with deeply nested directories (especially so when running unoptimized bits).
Reduced the stack frame size by passing the native struct used by ref and removing unnecessary throw/catch blocks. Other optimizations and logic clarfications.
Made the native struct blittable and introduced a helper struct set for fixed size blittable strings.
* Update comments
* Use span prototype
* Switch to ReadOnlySpan
* Update packages
* Mark System.Memory as inbox on UAP
* Packaging fixes
* Factor out package configs
Commit migrated from https://github.com/dotnet/corefx/commit/1d3cc0417753bf0a436824abfeff9c3c1712f63f