Bug 18361 - FileInfo.MoveTo does not work with absolute paths
Summary: FileInfo.MoveTo does not work with absolute paths
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: mscorlib ()
Version: master
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: marcos.henrich
URL:
Depends on:
Blocks:
 
Reported: 2014-03-13 13:08 UTC by Aaron Bockover [MSFT]
Modified: 2016-02-16 13:59 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Aaron Bockover [MSFT] 2014-03-13 13:08:59 UTC
new FileInfo ("/Users/aaron/fileinfotest").MoveTo ("fileinfotest")

I would expect the above to move "/Users/aaron/fileinfotest" to $PWD/fileinfotest, but the move never happens.

File.Move ("/Users/aaron/fileinfotest", "fileinfotest") however works as expected.

new FileInfo ("a").MoveTo ("b") however does work... there seems to be an issue with absolute paths. This is tested on 3.4.0 (Mono JIT compiler version 3.4.0 ((no/6b959ef Mon Mar 10 12:30:52 EDT 2014)).
Comment 1 marcos.henrich 2016-02-16 11:29:54 UTC
Should be fixed by https://github.com/mono/mono/pull/2623.
Comment 2 marcos.henrich 2016-02-16 13:59:58 UTC
Fixed in mono/master 455d287931bc79b70e162c765bba2396b92023b7.
https://github.com/mono/mono/commit/455d287931bc79b70e162c765bba2396b92023b7