From: Eric Christopherson Date: 2013-05-14T12:32:10+09:00 Subject: Re: copying files syntax with FileUtils.rb (grr.) --089e01184b0e0c2e3004dca5470e Content-Type: text/plain; charset=UTF-8 On Mon, May 13, 2013 at 10:04 PM, Thomas Luedeke wrote: > Two things: > > (1) I still have trouble with this. I'm following Doug's example, and > I'm getting this exception about the target directory. The script > output: > > The file to be moved is > > "/home/t3905/codes/xcobra/ddec12/nhyd_mod/build/new_build/mod_files/ANF1_diff_wb" > > The destination file is > > "/home/t3905/codes/xcobra/ddec12/nhyd_mod/build/new_build/hp/file_diff/source_diff/ANF1_diff_wb" > > So the current file plus path and destination file plus path are all > set. Now I simply do the FileUtils.cp (or .mv) using the regular > syntax. Naturally, it does not work: > > Exception `Errno::ENOENT' at > /home/t3905/ruby/ruby-1.8.7-p22/lib/ruby/site_ruby/1.8/fileutils.rb:1420 > - No such file or directory - > > /home/t3905/codes/xcobra/ddec12/nhyd_mod/build/new_build/hp/file_diff/source_diff/ANF1_diff_wb > > Why is it puking about the destination file not existing? That's why > I'm trying to move it.. > My guess is that the directory .../hp/file_diff/source_diff/ doesn't exist. > > > > (2) I have no idea why I should continue fighting this, when I can > simply utilize a system command that I *never* have to fight with. > Using a UNIX cp works simpler and easier on both Linux and other UNIX > platforms, and I never have any problems with it. Never. > > -- > Posted via http://www.ruby-forum.com/. > > --089e01184b0e0c2e3004dca5470e Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Mon, May 13, 2013 at 10:04 PM, Thomas Luedeke <list= s@ruby-forum.com> wrote:
Two things:

(1) I still have trouble with this. =C2=A0I'm following Doug's exam= ple, and
I'm getting this exception about the target directory. =C2=A0The script=
output:

The file to be moved is
"/home/t3905/codes/xcobra/ddec12/nhyd_mod/build/new_build/mod_files/AN= F1_diff_wb"

The destination file is
"/home/t3905/codes/xcobra/ddec12/nhyd_mod/build/new_build/hp/file_diff= /source_diff/ANF1_diff_wb"

So the current file plus path and destination file plus path are all
set. =C2=A0Now I simply do the FileUtils.cp (or .mv) using the regular
syntax. =C2=A0Naturally, it does not work:

Exception `Errno::ENOENT' at
/home/t3905/ruby/ruby-1.8.7-p22/lib/ruby/site_ruby/1.8/fileutils.rb:1420 - No such file or directory -
/home/t3905/codes/xcobra/ddec12/nhyd_mod/build/new_build/hp/file_diff/sourc= e_diff/ANF1_diff_wb

Why is it puking about the destination file not existing? =C2=A0That's = why
I'm trying to move it..

My gu= ess is that the directory .../hp/file_diff/source_diff/ doesn't exist.<= /div>
=C2=A0



(2) I have no idea why I should continue fighting this, when I can
simply utilize a system command that I *never* have to fight with.
Using a UNIX cp works simpler and easier on both Linux and other UNIX
platforms, and I never have any problems with it. =C2=A0Never.

--
Posted via http://= www.ruby-forum.com/.


--089e01184b0e0c2e3004dca5470e--