From: WATANABE Hirofumi Date: 1999-07-27T17:31:57+09:00 Subject: [ruby-dev:7446] Re: [PATCH] tools.rb わたなべです. 石塚圭樹 writes: :移動先のパーティションが同じなら問題ないんですが, 違うと問題ありますです. なるほど. rename が失敗するときって DOS や Windows のことし か考えてませんでした. ちょっと安直な気もするけど. --- lib/ftools.rb.orig Fri Apr 2 12:48:23 1999 +++ lib/ftools.rb Tue Jul 27 15:04:03 1999 @@ -76,8 +76,12 @@ rescue - from_stat = stat(from) - syscopy from, to and unlink from - utime(from_stat.atime, from_stat.mtime, to) begin - chown(fstat.uid, fstat.gid, tpath) + symlink File.readlink(from), to and unlink from rescue + from_stat = stat(from) + syscopy from, to and unlink from + utime(from_stat.atime, from_stat.mtime, to) + begin + chown(fstat.uid, fstat.gid, tpath) + rescue + end end