* Fix using Directory to move files
See dotnet/corefx#19710. NetFX behavior is that you can use Directory
to move files. This was broken trying to match other legacy
behavior in dotnet/corefx#17913. Tested on NetFX and CoreFX.
* Fix check for Unix
Unix impl doesn't tolerate a trailing separator. Public api
explicitly checks for this.
* More fixes and tests
Unix won't move the file with a trailing slash. Add more tests
for different combinations of trailing slashes. Validated against
NetFX.
* Attempt to get MoveDirectory further aligned
Trying to handle trailing separator on a source file cases
in the same way as Windows.
* Extend tests, move Unix condition
* Another tweak and more tests
* Fix comment
Commit migrated from https://github.com/dotnet/corefx/commit/ea514e2f4e61bd3128ea3753071af2681f17f063
The FileShareOpen test has been failing sporadically with sharing violations. It turns out the problem has to do with FileShare.Inheritable being included in the list of FileShare values to test. If another test in the same process concurrently spawns a process while a FileShare.Inheritable file is open, that file's handle will be inherited into the child process, which will in turn keep the file in use for longer than the test expects. When it then tries to re-open the file, it may encounter a sharing violation if the subsequent open is incompatible with the previous one's FileShare.
Commit migrated from https://github.com/dotnet/corefx/commit/041672ff3642753807a4502a4c407cb82bfa1009
In some of our test suites, we use a pattern where a base class contains the core test logic and then derived classes override various members in those base classes to customize the actual tests. xunit then runs the base methods for each of the derived types.
Since xunit by default parallelizes inter-class, meaning it won't parallelize tests on the same class but will on different classes, tests on the base class may run in parallel with themselves, though, when actually being run for different concrete derived types. This is problematic when the tests pick temporary file names based on the test itself, e.g. using the FileCleanupTestBase helper that derives a temporary file name from the current member name, line number, etc.
To avoid such conflicts, this changes adds a random identifier into each such temporary file name.
Commit migrated from https://github.com/dotnet/corefx/commit/8c16d26d42c3aa81b28e4aeb790a821bd67c03b8
Neither the link/unlink nor copy-all-data approaches work well on a case-insensitive file system when just changing the casing of the file name. This commit adds an upfront check that detects when the files are the same, and in such cases, just does a rename.
Commit migrated from https://github.com/dotnet/corefx/commit/f29050cf9cad6e62afc3cb4917e1e9056a1abe3c
We currently consider a file to be hidden if its name starts with a period. That applies to directories as well. But if the directory name in the FileSystemInfo ends with a '/', then the file name that comes back from GetFileName is empty, and it's actually the GetDirectoryName value we want to check for a period.
Commit migrated from https://github.com/dotnet/corefx/commit/de10647c8f3cb4190653bf243c515d3431689004
Now instead of Use*Key a project can instead define the assembly key
in the project (genreally the common dir.pops for a project) using
the AssemblyKey property. The accepted values are Open, ECMA, MSFT,
Test.
This change allows for a repo to set the default key they want to use
for projects. In corefx we have switched the default to use the Open
key instead of the old BuildTools default of MSFT key.
As part of this update we are explicitly setting the AssemblyKey in
all the library projects (although it is really only necessary for
projects that aren't the default).
Also with this change we are updating all the new libraries that have
not yet shipped stable (compared to our 1.1 release) and making them
use the Open key. Which means that for prerelease dependencies there
might be some binary breaking changes to consume.
The following libraries ahven't shipped so there key is being
changed from MSFT to Open:
Microsoft.XmlSerializer.Generator
System.CodeDom
System.Configuration.ConfigurationManager
System.Data.Odbc
System.DirectoryServices
System.DirectoryServices.AccountManagement
System.DirectoryServices.Protocols
System.IO.Ports
System.Json
System.Memory
System.Net.HttpListener
System.Net.Mail
System.Net.ServicePoint
System.Net.WebClient
System.Net.WebProxy
System.Private.Xml
System.Private.Xml.Linq
System.Security.Cryptography.Xml
System.Security.Permissions
System.Transactions.Local
System.Web.HttpUtility
Commit migrated from https://github.com/dotnet/corefx/commit/ac09a797d09502ebab61f7167bb856846602e1e6
* Fix UWP Pinvoke checker condition
* analyzer baselines
* Remove redundant local define
* Remove redundant CA lines
* Special case Registry
* Fix BlockReflectionAttribute
* Replace NETNATIVE with uap define
* baselines
* Disable Pinvoke scan on specific projects
* Disable BlockReflectionAttribute on ilproj
* Revive 2 baselines
* Disable UWP validation on SQlClient
* Convert some defines to `uwp`
* Fix S.N.Primitives baseline
* Remove dead baselines
* Clean up NET_NATIVE defines
* Remove FEATURE_CORECLR except from shared sources
* Change Threading.Thread defines to just uapaot
* Fix comment
* Fix comment 2
* Change serialization uap defines to uapaot
* Rename EnableWinRT to UWPCompatible
* Fix UAP build for Console
* Fix uap condition in XML csproj
* Fix condition in XmlSerializer project
* Replace netcore50
* Remove dead #if
* Redundant console condition
* Redundant console condition2
* Trim baseline
* Revert Console baseline to pre UAP
* Fix MemoryMappedFiles uap build
* Fix S.Linq.Expressions build for UAP by temporarily disabling it
* Fix S.N.Sockets build for uap
* No plans to put SQLClient in UWP
* Fix RuntimeInformation build
* Fix MemoryMappedFiles build for Unix
* Add UWPCompatible to all netstandard versions
* Add EnablePinvokeAnalyzer to disable Pinvoke checking entirely for some reason
* Remove dead System.Xml.XmlSerializer.Tests.settings.targets
* Fix interop services build
* Remove last uap/uapaot define in Xml tests
* PInvoke check doc
* Fix PInvoke casing
* PInvoke file is case sensitive
* Remove unnecessary references to uapaot from projects that don't have uapaot configs
* Remove unnecessary uapaot from S.R.I.RI
* Replace UWPCompatible for TargetGroup in csproj conditions
* Reverse FileSystem edit as not ready to build for UWP
Commit migrated from https://github.com/dotnet/corefx/commit/b1865ea0847a7a86baefe8378b772ecf0b785681
* Uri: detect Unix path on Unix, detect Dos&Unc path on Windows
* Update System.IO.Packaging/tests
* Update System.Xml.XmlSchema.XmlSchemaValidatorApi.Tests
* Update Common.Tests
* Update System.Private.Uri.Functional.Tests
* Update System.Private.Uri.ExtendedFunctional.Tests
* Update System.Runtime/tests
* Uri.MethodsTests.cs: comment out failing inputs
* Restore uri minimal length of 3
* Require unix paths to start with a /
* Allow Unix path file uri to start with '\'
* FileWebRequestTest: revert extra slashes added (file:/// back to file://)
* Uri: fix empty newHost bug and revert workaround in IriTest
* Annotate PlatformSpecific tests
* IdentityHelperTests: use file path that works on Windows and Linux
* System.IO.Packaging/tests: rename s_LocalFile to s_fullPathToLocalFile
* Uri: update comments on minimal Uri length check, don't check length twice on Windows
* Use PlatformDetection.IsWindows
* Ensure Roslyn gets rid of UnixPath checks on Windows by adding IsWindowsSystem (const bool) checks
* Uri: Fix uapaot build by including Uri.Windows.cs
* IdentityHelperTests: rename GetNormalizedUrlHash_Unix -> GetNormalizedUrlHash
* Uri.MethodsTests: don't require GetHashCode to return different values when Uris only differ in case
* s_IsWindowsSystem -> s_isWindowsSystem
* Detect Dos and Unc paths on Unix
* Update tests
* Clean-up
* Clean-up II
* Clean-up III
* Clean-up IV
* Clean-up V
* Move Flags.UnixPath to the end of the Flags enum
Commit migrated from https://github.com/dotnet/corefx/commit/7df6b74cc4aeebc86e76b5c7901a59fa7fa793f6