Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Directory.Move no longer moves files #21673

Closed
slozier opened this issue May 12, 2017 · 3 comments
Closed

Directory.Move no longer moves files #21673

slozier opened this issue May 12, 2017 · 3 comments
Assignees
Milestone

Comments

@slozier
Copy link
Contributor

slozier commented May 12, 2017

The following works fine with net45 and netcoreapp1.0, throws a DirectoryNotFoundException with 2.0.

File.Create("test.txt").Dispose();
Directory.Move("test.txt", "test2.txt");
@stephentoub
Copy link
Member

Likely broken here:
dotnet/corefx@074bf02
cc: @alexperovich, @JeremyKuhne, @ianhays

@JeremyKuhne JeremyKuhne self-assigned this May 12, 2017
@JeremyKuhne
Copy link
Member

Fixing.

JeremyKuhne referenced this issue in JeremyKuhne/corefx May 12, 2017
See #19710. NetFX behavior is that you can use Directory
to move files. This was broken trying to match other legacy
behavior in dotnet#17913. Tested on NetFX and CoreFX.
JeremyKuhne referenced this issue in dotnet/corefx May 13, 2017
* Fix using Directory to move files

See #19710. NetFX behavior is that you can use Directory
to move files. This was broken trying to match other legacy
behavior in #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
@JeremyKuhne
Copy link
Member

Fixed

@msftgits msftgits transferred this issue from dotnet/corefx Jan 31, 2020
@msftgits msftgits added this to the 2.0.0 milestone Jan 31, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants