Commit Graph
1561 Commits
Author SHA1 Message Date
Jeremy Kuhne 76fff21677 Add some pattern transformation tests (dotnet/corefx#27133)
Commit migrated from https://github.com/dotnet/corefx/commit/11182e0c4e65fb1e6fa0596ca9d991e3382c9fb2
2018-02-14 16:06:04 -08:00
Jeremy Kuhne 985d730865 API tweaks to match latest updates to spec (dotnet/corefx#27102)
* API tweaks to match latest updates to spec

Add a few new tests

See dotnet/corefx#25873

* Properly clear state when enumerating on Unix.
Make sure we don't include special directories in subdir processing. Add test.
Collapse helper that was only called in one place, and remove dead one.


Commit migrated from https://github.com/dotnet/corefx/commit/1c9cd8118abfa13165d88a4e660fbdcc6c2ebc4c
2018-02-13 21:49:57 -08:00
Stephen Toub f8e6f41b81 Clear initlocals in a bunch of assemblies (dotnet/corefx#26993)
* 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
2018-02-13 06:30:25 -05:00
Jeremy Kuhne 478a57f64e Switch from using SafeHandle for Unix enumeration (dotnet/corefx#27052)
* Switch from using SafeHandle for Unix enumeration

* Address feedback

* Fix faceplant, dispose in test.


Commit migrated from https://github.com/dotnet/corefx/commit/c9100ffc2988a0faf0e92898762a445ccb3c0e13
2018-02-12 13:56:17 -08:00
Jeremy Kuhne fbbfa8167b Fix *Info classes for Unix when opened on root (dotnet/corefx#27024)
Commit migrated from https://github.com/dotnet/corefx/commit/5349873018e481a2ad8a14bbdd5ff237780f02e3
2018-02-10 17:19:49 -08:00
Stephen Toub e82ffa3f5f Add FileStream tests for custom OwnedMemory with Read/WriteAsync (dotnet/corefx#26931)
Commit migrated from https://github.com/dotnet/corefx/commit/7130581c8bd7114143628679624f7ae29cb56818
2018-02-10 07:11:12 -05:00
Jeremy Kuhne 99e5facebf Fix Unix enumeration (dotnet/corefx#27019)
For non-trivial recursive enumerations we were running out of file descriptors. Stop creating them when we queue pending subdirectories and only create when we dequeue.

Commit migrated from https://github.com/dotnet/corefx/commit/430de8f582afb111697dd1e203f5c7a20f46acb2
2018-02-09 20:33:26 -08:00
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