From: Gennady Bystritksy Date: 2004-12-23T06:25:49+09:00 Subject: Re: All I want to do is move a directory :( trans. (T. Onoma) wrote: > Very frustrated. I have just spent well over an hour trying to do the simplest > of all things: move a directory. Of course, I want to do it in Ruby but this > doesn't work: > > FileUtils.mv( @dir, ".trash/" ) > > Could someone please show me why am I apparently so stupid. > > Thanks, > T. > > > > > > What excactly are you experiencing? On what platform? On my Linux box with Ruby 1.6.8 when I do $ mkdir aaa $ mkdir .trash $ irb -r fileutils irb(main):001:0> FileUtils.mv "aaa", ".trash/" it works just fine. The only thing is that if ".trash/aaa" already exists, I get an exception: Errno::EISDIR: Is a directory - ".trash/aaa" from /usr/local/lib/ruby/site_ruby/1.6/fileutils.rb:396:in `open' from /usr/local/lib/ruby/site_ruby/1.6/fileutils.rb:396:in `copy_file' from /usr/local/lib/ruby/site_ruby/1.6/fileutils.rb:395:in `open' from /usr/local/lib/ruby/site_ruby/1.6/fileutils.rb:395:in `copy_file' from /usr/local/lib/ruby/site_ruby/1.6/fileutils.rb:445:in `mv' from /usr/local/lib/ruby/site_ruby/1.6/fileutils.rb:432:in `fu_each_src_dest' from /usr/local/lib/ruby/site_ruby/1.6/fileutils.rb:432:in `mv' from (irb):1 Gennady.