Commit Graph
1154 Commits
Author SHA1 Message Date
Jeremy Kuhne 8d26cb462d Make Unix filename conversion lazy (dotnet/corefx#26978)
* Make Unix filename conversion lazy

Also hook error handling.

* Address feedback


Commit migrated from https://github.com/dotnet/corefx/commit/ef0aca54454748002325b750c839dacba6ed3999
2018-02-08 22:50:38 -08:00
Jeremy Kuhne 113d51c8f3 Reduce Unix enumeration allocations (dotnet/corefx#26942)
* 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
2018-02-08 12:55:15 -08:00
Jeremy Kuhne 1ba1a9f26b Fix accessing trimmed paths (dotnet/corefx#26918)
* 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
2018-02-07 13:01:16 -08:00
Jan Kotas 5e6591c633 Delete dead or redundant code (dotnet/corefx#26890)
Commit migrated from https://github.com/dotnet/corefx/commit/2b90844626772de05c4ad4c5e349c67e1ded5aa5
2018-02-06 09:11:38 -08:00
Jeremy Kuhne 3d70535133 Add the ability to specify case matching behavior for GetFiles (dotnet/corefx#26876)
Commit migrated from https://github.com/dotnet/corefx/commit/08dad51fac5f51eaa8fe19ae0997dd6bfb9706ec
2018-02-05 20:02:52 -08:00
Jeremy Kuhne b7ad3f9218 File enumeration extensibility (dotnet/corefx#26806)
* 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
2018-02-05 15:28:14 -08:00
Stephen Toub 6899ebcd1a Use corelib-shared ValueStringBuilder
Use the shared version, delete the copy.


Commit migrated from https://github.com/dotnet/corefx/commit/3d1ebc18c356b03039d24c29939dae374c64b4a5
2018-01-29 10:42:52 -08:00
Jan Kotas a064cb1858 Delete FileSystem abstraction (dotnet/corefx#26473)
* Delete FileSystem abstraction

* Delete unused files


Commit migrated from https://github.com/dotnet/corefx/commit/4e6c3c68dd2694aed1aa95d275953568116f237a
2018-01-20 08:14:28 -05:00
Jan Kotas 2f256dc4ea Delete unused WinRT multiplexing file system (dotnet/corefx#26450)
Commit migrated from https://github.com/dotnet/corefx/commit/aad322682f9625936ed15f61f5d44da5bb05c64a
2018-01-19 10:52:44 -08:00
Dan Moseley 81727726e0 Disable Millisec test for all Unix (dotnet/corefx#26384)
* Disable Millisec test for all Unix

* Typo


Commit migrated from https://github.com/dotnet/corefx/commit/c8593a626b6f59b835876a4579ce2b32f56e1077
2018-01-17 16:11:33 -08:00
Dan Moseley b1b1d91e25 Disable Msec test on macOS (dotnet/corefx#26350)
Commit migrated from https://github.com/dotnet/corefx/commit/04e2be220ee82171aaacef560d2b8270f82282dc
2018-01-15 15:51:49 -08:00
Dan Moseley 5319d7787e Add nanosecond granularity to Unix filesystem time reads (dotnet/corefx#26176)
* 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
2018-01-15 08:10:27 -08:00
Jan Kotas e6c28ba3b1 Cleanup CodeContracts annotations (dotnet/corefx#26324)
Commit migrated from https://github.com/dotnet/corefx/commit/a3e4e241c7b7c33750258082969287b9cf45d757
2018-01-14 14:19:41 -05:00
Ahson Khan 1e8ee6f672 Remove leftover uses of DangerousGetPinnableReference (dotnet/corefx#26037)
* Remove leftover uses of DangerousGetPinnableReference

* Add reference to system.memory


Commit migrated from https://github.com/dotnet/corefx/commit/f965141b767517d465c03b899dc87b2e52d2e6fc
2017-12-23 10:17:55 -08:00
Ahson Khan 7886be085d Convert uses of the Dangerous APIs to use MemoryMarshal.GetReference (dotnet/corefx#25936)
* Convert uses of the Dangerous APIs to use MemoryMarshal.GetReference

* Fix unresolved merge conflict.

* Add using directive

* Add missing using directives.

* Add references to System.Memory


Commit migrated from https://github.com/dotnet/corefx/commit/40cbd5636851093309b841db4d53af369b7ef1c6
2017-12-21 11:05:06 -08:00
ahsonkhan a1704d7dd9 Revert "Temporarily removing use of ReadOnlySpan indexer. (dotnet/corefx#25881)"
This reverts commit dotnet/corefx@f8057ccba5.


Commit migrated from https://github.com/dotnet/corefx/commit/4110bfa4e18a0a0b4cc9736f20a1987bc048d0e5
2017-12-15 15:59:37 -08:00
ahsonkhan 02c83e552d Revert "Temporarily removing leftover use of ReadOnlySpan indexer. (dotnet/corefx#25908)"
This reverts commit dotnet/corefx@bbe425ecdc.


Commit migrated from https://github.com/dotnet/corefx/commit/4c6a8470cb020b20a444563fa42249c160442c16
2017-12-15 15:59:28 -08:00
Ahson Khan 5e3b280749 Temporarily removing leftover use of ReadOnlySpan indexer. (dotnet/corefx#25908)
* Temporarily removing leftover use of ReadOnlySpan indexer.

* Fixing some typos and marking method as unsafe.


Commit migrated from https://github.com/dotnet/corefx/commit/bbe425ecdcc5caaec43d22862187a78d7c582aab
2017-12-13 15:37:02 -08:00
Ahson Khan 899726a465 Temporarily removing use of ReadOnlySpan indexer. (dotnet/corefx#25881)
Commit migrated from https://github.com/dotnet/corefx/commit/f8057ccba56262c28bd09cdbb781b10bc3954590
2017-12-12 19:54:03 -08:00
Anirudh Agnihotry 04c6f66b04 Fix tests for path validation changes on Windows And Unix (dotnet/corefx#25788)
Commit migrated from https://github.com/dotnet/corefx/commit/fc0e922bb1d5e92414acb6869d8a7aa3502f6b1c
2017-12-08 14:41:55 -08:00
Stephen Toub e492fe23ba Disable failing tests after path validation updates
Commit migrated from https://github.com/dotnet/corefx/commit/c0817aec1c3fbf9ee8bdbba286edbf1c9c3c64c4
2017-12-03 12:08:32 -05:00
Jeremy Kuhne 3307889b0c Fast file enumeration for Windows (dotnet/corefx#25426)
* 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
2017-11-30 15:46:56 -08:00
Anirudh Agnihotry 36b9502f92 Removed Check Invalid Path Chars (dotnet/corefx#25458)
* Removed Invalid path characters

* removed implememtation and tests

* Removed Dead Functions

* Failing test disabled

* Removed the disabled test


Commit migrated from https://github.com/dotnet/corefx/commit/06c9959e69e89645dd0c3cf5781b646028479868
2017-11-28 17:24:07 -08:00
Jan Kotas 27d98c0776 Delete unnecessary SecurityCritical and SecuritySafeCritical annotations
Commit migrated from https://github.com/dotnet/corefx/commit/0bb106232745aedfc0d0c5a84ff2b244bf190317
2017-11-19 10:37:38 -08:00
Jeremy Kuhne 4c7142aaec Clean up CreateFile usage. (dotnet/corefx#25318)
* 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
2017-11-17 18:20:39 -08:00
Jeremy Kuhne 44c8e8ab61 Use FILE_TIME in WIN32_FILE_ATTRIBUTE_DATA (dotnet/corefx#25288)
Commit migrated from https://github.com/dotnet/corefx/commit/47cb531a283ce7264544624f0942c71c106b34ab
2017-11-16 06:44:24 -08:00
Stano Peťko 1a70106b96 File path is in IO exception messages (dotnet/corefx#25195)
* Added path to message Argument_InvalidPathChars.

* Added path to message IO_PathTooLong.

* IO_PathTooLong - separate message when path is empty.

* Added argument reference to message.


Commit migrated from https://github.com/dotnet/corefx/commit/51da21f9934c63216a8d7a2eb27ec5aa97944600
2017-11-14 23:09:24 -05:00
Frederik Carlier a1d44f82ce Fix casing of .uap (dotnet/corefx#25185)
Commit migrated from https://github.com/dotnet/corefx/commit/025230bc5dacab6d012a537c583003ea96381c97
2017-11-12 22:36:21 -05:00
Krzysztof Wicher f3f741eade Use distro detection from Microsoft.DotNet.PlatformAbstractions (dotnet/corefx#24531)
Commit migrated from https://github.com/dotnet/corefx/commit/4bf90198c5e7710ea67b7c1b467e859ec8bb78e5
2017-11-03 14:30:47 -07:00
Stephen Toub 54c1d578d8 Mark applicable structs as readonly
Commit migrated from https://github.com/dotnet/corefx/commit/54e889a7c71bf22f9f1ef244a9d040fee64c74d5
2017-11-03 09:48:47 -04:00
Stano Peťko edbb8b4848 Deleted dead code from System.IO.FileSystem. (dotnet/corefx#24701)
Commit migrated from https://github.com/dotnet/corefx/commit/79089260b0bf00e99ba9dd7e736c7b2d776fed0a
2017-10-17 17:33:53 -04:00
Jeremy Kuhne 733ebce7dd Allow directory not empty errors (dotnet/corefx#24382)
If we've successfully removed all of the file content without errors we should allow for directory not empty to allow for active file handles to close.

Commit migrated from https://github.com/dotnet/corefx/commit/e791e8b7a4f1e4d6ff5b4295fad04a6c9f65e909
2017-10-03 12:52:39 -04:00
Kasper Fabæch Brandt 81f81c3e4c Add test for dotnet/corefx#24081 (succeeds after dotnet/coreclrdotnet/corefx#14043) (dotnet/corefx#24163)
Commit migrated from https://github.com/dotnet/corefx/commit/819da8af67f04867012a3fb274e1eca6078a048e
2017-10-02 23:56:07 -04:00
Eric Mellino f717af1490 Disable RecursiveDelete_DeepNesting (Issue dotnet/corefx#24242). (dotnet/corefx#24243)
Commit migrated from https://github.com/dotnet/corefx/commit/6cee65c560f1b853f67c7871345c0feacd95a070
2017-09-25 20:12:23 -07:00
Stephen Toub c58d6840dc Expose/add tests for Memory-based Stream overloads (dotnet/corefx#23776)
Commit migrated from https://github.com/dotnet/corefx/commit/4001151f37e05146e870e96f2a8d417193447c33
2017-09-11 10:03:31 -04:00
Dan Moseley b27ba97af5 Rename IsWinRT to IsInAppContainer (dotnet/corefx#23935)
* Rename IsWinRT to IsInAppContainer

* Grep error


Commit migrated from https://github.com/dotnet/corefx/commit/8d51233795da222041c23d33b1eb44bbe458d0eb
2017-09-11 02:57:28 -04:00
Dan Moseley e24a0bcdbc Disable RO-filesystem tests on RH69 (dotnet/corefx#23842)
* Disable RO filesystem tests on RH69

* Disable


Commit migrated from https://github.com/dotnet/corefx/commit/3f6fc6bdb578cfa06324735a2fcab09decced96a
2017-09-06 21:47:40 -07:00
Tarek Mahmoud Sayed 45ebc07bd8 Enable detecting Red Hat distors in PlatformDetection (dotnet/corefx#23775)
* Enable detecting Red Hat distors in PlatformDetection

* Add RedHat properties to PlatformDetection class


Commit migrated from https://github.com/dotnet/corefx/commit/f0a9551d38ddf76a02c4c65cce74559263466ddd
2017-09-05 15:03:06 -07:00
Dan Moseley 1b50c157a6 Disable RecursiveDelete_DeepNesting for desktop (dotnet/corefx#23757)
Commit migrated from https://github.com/dotnet/corefx/commit/499e099dc8e9e8495b602a623c96c8695d5a4d53
2017-09-01 16:16:20 -07:00
Santiago Fernandez Madero 9444c340dc Port rollback of System.IO DCR from release branch to master (dotnet/corefx#23566)
* Port rollback of System.IO DCR from release branch to master


Commit migrated from https://github.com/dotnet/corefx/commit/7f1c480a6a280fbced29606120b507596bafbefc
2017-09-01 00:18:59 -07:00
Eric StJohn 3be4c0beb2 Merge pull request dotnet/corefx#23559 from ericstj/updateBuildTools
Update build tools

Commit migrated from https://github.com/dotnet/corefx/commit/b0d2f1d49c063f4d0239a780714189391ece76a9
2017-08-28 05:49:51 -07:00
Jeremy Kuhne d9d8cd8b89 Add tests to validate we don't fall over enumerating files that just … (dotnet/corefx#23528)
* 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
2017-08-25 17:08:27 -07:00
Eric St. John e047f03838 Fix errors with new CSC due to missing comma between attributes
Commit migrated from https://github.com/dotnet/corefx/commit/535828b1423795a71f0b17e0c9d00e99021deed5
2017-08-25 14:05:48 -07:00
Jan Kotas e184dce453 Make DisableMediaInsertionPrompt to be private struct to match CoreLib (dotnet/corefx#23507)
Commit migrated from https://github.com/dotnet/corefx/commit/94b19a4a2405c9fabaf6564cb49cbc4b0957ac6c
2017-08-24 17:13:27 -07:00
Stephen Toub 471a3f75a8 Add tests for FileStream span-based overrides (dotnet/corefx#23481)
Commit migrated from https://github.com/dotnet/corefx/commit/7c35a83d31acf6c8f67ab8714847c71107a8b5db
2017-08-24 12:35:39 -04:00
Jeremy Kuhne 13b6f4095c Use FromApp APIs to allow brokered file access (dotnet/corefx#23316)
* 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
2017-08-21 18:34:32 -07:00
Tarek Mahmoud Sayed 3765a6069b Moving PlatformDetection to Corefx.Private.TestUtilities assembly (dotnet/corefx#23109)
* 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
2017-08-10 22:37:36 -07:00
Jeremy Kuhne 5aaa274e86 Improve directory deletion stack pressure (dotnet/corefx#22596)
* 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
2017-08-03 16:19:02 -07:00
Santiago Fernandez Madero 4cf54c17b9 Fix System.IO.FileSystem.Tests in UapAot (dotnet/corefx#22513)
* Fix System.IO.FileSystem.Tests in UapAot

* Fix CI Failures


Commit migrated from https://github.com/dotnet/corefx/commit/912d2e27375f8f74a15b87dbef212027827f127b
2017-07-21 21:33:59 -07:00
Santiago Fernandez Madero e8aa3151cc Re-enable long path tests for Uap (dotnet/corefx#22505)
Commit migrated from https://github.com/dotnet/corefx/commit/b2b47908656ef3b7dcaef62fb342e12aee5f34c4
2017-07-21 15:30:49 -07:00