Adds negative tests for Begin/End, removes unnecessary block for `\\.\`
paths.
(The block for `\\.\` paths fulfills a need that predates our supported
Windows OSes. You cannot inadvertently mess up "raw" drives. In addition
we currently allow `\\?\` which is another form of device path access.)
Commit migrated from https://github.com/dotnet/corefx/commit/5376c25bea9523265696ed5806f3dc8b51bbbf25
- .CoreCLR.cs: CoreCLR-runtime specific files
- .CoreRT.cs: CoreRT-runtime specifc files
- .Uap.cs: Universal app platform specific files. Both UAP (Universal App Platform) and UWP (Universal Windows Platform) have been used interchangeably. I have picked UAP for the file names since it is the name used in the RID (e.g. uap101). There are number of places where UWP is used in the comments and such - I have not done anything about those.
Update documentation to match the current state of affairs
- Delete stale guidance for facade projects
- Update lists and examples to use the current RIDs
- Fix some typos
Fixes issue dotnet/corefx#9875.
Commit migrated from https://github.com/dotnet/corefx/commit/1ef561911eeabbee76e764946e40358fcd5ba144
Remove references to all depprojs where the exact same file can be
included via harvesting.
Remove all depproj's that are no longer referenced.
The only depprojs that remain are those that are required for live p2p
references.
Commit migrated from https://github.com/dotnet/corefx/commit/d5ea64de4e7092aed686faabfa2a638fe7a322b8
My previous change to reuse reference assemblies from past packages
caused some packages to downgrade reference assembly versions.
Since our references build against packages (LKG) some assemblies higher
in the stack reference the old, higher, versions. This caused the
compiler to complain that types were referenced in a higher version than
what was consumed by the compiler.
Temporarily use project-references to get past this and produce a
consistent set of packages. This change can be reverted after we
update to a set of packages produced with this change.
Commit migrated from https://github.com/dotnet/corefx/commit/5c2c44095544cf4d1f2267cc2372cfc1a748c4c6
With getting buffers from the ArrayPool, we want to clear the buffers before we put them back into the pool. But we only need to clear the max amount we used, and we're very likely to be using much larger buffers than we actually need. This change keeps track of how much space we used and only clears that much.
Commit migrated from https://github.com/dotnet/corefx/commit/b1cef729e9ce02f5ccc3d5aefad9076ccb791d38
Rather than allocating a new buffer in CopyToAsync, take one from the shared array pool. This drastically reduces the memory allocation from a FileStream.CopyToAsync operation, and helps to improve throughput as a result. In one microbenchmark that repeatedly copied an 80K file with CopyToAsync's default args, throughput increased by 20% and gen0 GCs decreased by 100x.
Commit migrated from https://github.com/dotnet/corefx/commit/cd0fdb83ac77ec80581f2a86a20f20126753be4e
Adds:
- File.WriteAllLines(string, string[])
- File.WriteAllLines(string, string[], Encoding)
- File.Replace(string, string, string)
- File.Replace(string, string, string, bool)
- File.Encrypt(string)
- File.Decrypt(string)
- FileInfo.Encrypt()
- FileInfo.Decrypt()
- FileStream.Handle
- FileStream.Lock(long, long)
- FileStream.Unlock(long, long)
Currently throws PlatformNotSupportedException from:
- Encrypt/Decrypt on all platforms. These can be implemented on Win32, but the APIs needed are not currently exposed as allowed in buildtools.
- Lock/Unlock on Unix and WinRT. These can be implemented on Unix; I just didn't in this commit.
Commit migrated from https://github.com/dotnet/corefx/commit/2fbc772ea8bd83a37b9f26c1a7c928a6be2d2c0b
Add an override of CopyToAsync in the Windows implementation of FileStream for use when the stream is constructed in async mode.
The base stream implementation does a simple loop that reads from the source and writes to the destination. For the Windows implementation of FileStream in async mode, each of these read operations involves overhead, such as allocating the task to return from the operation, registering with the providing cancellation token, etc. For CopyToAsync, we’re responsible for all of the reads, which means we can avoid these per-read costs.
Copying a 10MB file to a MemoryStream with the default buffer size and with a cancelable token improved throughput by 50%, and (not including the copy buffer) reduced the number of allocations from 860 to 11 and the bytes allocated from 52K to ~730b. Copying a 100 byte file to a MemoryStream with the default buffer size and with a non-cancelable token improved throughput by 30% and (not including the copy buffer) reduced the number of allocations from 46 to 11 and the bytes allocated from 1.1K to ~670b.
(I briefly explored adding an override for when in sync mode, but the savings there aren’t nearly as significant or measurable. At best it can avoid a Task per read. We can look more seriously at doing that separately, if desired; that could likely also be done for the Unix implementation.)
Commit migrated from https://github.com/dotnet/corefx/commit/daf9745a6871a6cf1e79c046d49033917757244f