[ruby-core:63640] [ruby-trunk - Bug #7707] FileUtils.mv fails to move symlink between filesystems

From: jacknagel@...
Date: 2014-07-10 20:46:04 UTC
List: ruby-core #63640
Issue #7707 has been updated by Jack Nagel.


In Homebrew, we have code that works around this by shelling out to `mv` wh=
en necessary. It would be nice to have this fixed.

----------------------------------------
Bug #7707: FileUtils.mv fails to move symlink between filesystems
https://bugs.ruby-lang.org/issues/7707#change-47690

* Author: Martin P=C3=A4rtel
* Status: Open
* Priority: Normal
* Assignee: Nobuyoshi Nakada
* Category: lib
* Target version: next minor
* ruby -v: ruby 1.9.3p362 (2012-12-25 revision 38607) [x86_64-linux]
* Backport:=20
----------------------------------------
FileUtils.mv sometimes fails with a "Errno::ENOENT: No such file or directo=
ry - /path/to/symlink" when attempting to move a directory containing a sym=
link between filesystems. This may be because it moves the destination file=
 before the symlink and then fails to move a "broken" symlink. Using the sh=
ell's "mv" instead works reliably.

A small test script is attached.

---Files--------------------------------
test.rb (627 Bytes)


--=20
https://bugs.ruby-lang.org/

In This Thread