--nextPart1200391.Mms6yP9lv3
Content-Type: text/plain;
charset s-ascii"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
Hello all,
A script I have written needs the ability to move files. I thought I would be
clever and use File.rename(old, newdir + new) but this is giving me an error:
`rename': Invalid cross-device link. I gather this is because I am renaming
the file to a different partition.
So then I found FileUtils and used:
require 'fileutils'
include FileUtils
mv( old, new)
This is working but seems an overly verbose and convoluted way to move a file.
I had a look at the fileutils.rb source and found this (for 'mv'):
# Moves file(s) +src+ to +dest+. If +file+ and +dest+ exist on the different
# disk partition, the file is copied instead
So I guess my real question is: is there a technical reason or some arbitrary
reason there is no File.move() method that can handle this transparently? I
would think it would be quite useful...
Any insight is appreciated,
-d
--
darren kirby :: Part of the problem since 1976 :: http://badcomputer.org
"...the number of UNIX installations has grown to 10, with more expected..."
- Dennis Ritchie and Ken Thompson, June 1972
--nextPart1200391.Mms6yP9lv3
Content-Type: application/pgp-signature
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
iD8DBQBE7OPowPD5Cr/3CJgRAhUCAJ9l96iPulTADd6DVxuYHP3/eYxCPwCeNkl7
+lUriMRAgr5tCBSE48bxZ5U tC
-----END PGP SIGNATURE-----
--nextPart1200391.Mms6yP9lv3--