Uh oh!
There was an error while loading. Please reload this page.
fix: handle case-sensitive file overwrite on Windows and add tests - #1259
Conversation
test: add tests for Windows file copy behavior
1277a9c to
fc24241CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This is addressed in release v22.0.13. |
ana1250
commented
Apr 4, 2025
Thanks! Looking forward to contributing more. |
| throw CommonExceptions.FileAlreadyExists(destFileName); | ||
| } | ||
| if (string.Equals(sourceFileName, destFileName, StringComparison.OrdinalIgnoreCase) && XFS.IsWindowsPlatform()) |
There was a problem hiding this comment.
in all the other cases we usemockFileDataAccessor.StringOperations.Equals(sourceFileName, destinationFileName) instead of relying onstring.Equals(..., ..., StringComparison.OrdinalIgnoreCase)
Is intentional or an oversight?
There was a problem hiding this comment.
This seems to be an oversight.
We had one case here where we used string.Equals on purpose, as it should compare case-sensitive in all operating systems, but here it seems I overlooked it.
This PR fixes an issue (#1140) where copying a file with the same name but different casing on Windows resulted in an "already in use" error. It aligns the behavior with the native file system.
Changes
System.IO.File.CopySystem.IO.File.MoveandSystem.IO.File.Replacebehavior.Testing