The :force option is mentioned in the docs, but it is rejected by
FileUtils.mv. It’s easy enough to use a ‘rescue Errno’ suffix to get
this behavior, so I’m not proposing it should be implemented as an
option to the method. Maybe just remove it from the documentation, then?
----------------------------------------------------------- FileUtils#mv
mv(src, dest, options = {})
···
Options: noop verbose
Moves file(s) +src+ to +dest+. If +file+ and +dest+ exist on the
different disk partition, the file is copied instead.
FileUtils.mv 'badname.rb', 'goodname.rb'
FileUtils.mv 'stuff.rb', 'lib/ruby', :force => true
Joel VanderWerf wrote:
The :force option is mentioned in the docs, but it is rejected by
FileUtils.mv. It’s easy enough to use a ‘rescue Errno’ suffix to get
this behavior, so I’m not proposing it should be implemented as an
option to the method. Maybe just remove it from the documentation, then?
Oops, ‘FileUtils.mv … rescue Errno’ is not what the force option would
do. So why isn’t :force implemented?
Hi,
In mail “Re: FileUtils.mv and the :force option”
···
Joel VanderWerf vjoel@PATH.Berkeley.EDU wrote:
The :force option is mentioned in the docs, but it is rejected by
FileUtils.mv. It’s easy enough to use a ‘rescue Errno’ suffix to get
this behavior, so I’m not proposing it should be implemented as an
option to the method. Maybe just remove it from the documentation, then?
Oops, ‘FileUtils.mv … rescue Errno’ is not what the force option would
do. So why isn’t :force implemented?
Because it is a bug.
I have implemented `force’ option now, thanks.
FYI: `Errno’ should be SystemCallError.
Best Regards,
Minero Aoki