FileUtils.mv Pointless Errno::ENOENT

I

Intransition

Noticed that when $DEBUG=true, any FileUtils.mv call produces two
(rescued) exceptions:

$ ls
sim-1.0.0.zip
$ irbException `Errno::ENOENT' at /usr/lib/ruby/1.8/fileutils.rb:1420 - No
such file or directory - sm.zip
Exception `Errno::ENOENT' at /usr/lib/ruby/1.8/fileutils.rb:1200 - No
such file or directory - sm.zip
 
R

Roger Pack

Thomas said:
Noticed that when $DEBUG=true, any FileUtils.mv call produces two
(rescued) exceptions:

It's probably checking for existence before doing the mv. why 2, I have
no idea :)
-r
 
7

7stud --

Thomas said:
Noticed that when $DEBUG=true, any FileUtils.mv call produces two
(rescued) exceptions:

$ ls
sim-1.0.0.zip
$ irb
Exception `Errno::ENOENT' at /usr/lib/ruby/1.8/fileutils.rb:1420 - No
such file or directory - sm.zip
Exception `Errno::ENOENT' at /usr/lib/ruby/1.8/fileutils.rb:1200 - No
such file or directory - sm.zip


/usr/lib/ruby/1.8/fileutils.rb:

def fu_same?(a, b) #:nodoc:
if fu_have_st_ino?
st1 = File.stat(a)
1420: st2 = File.stat(b)



def lstat
if dereference?
1200: @lstat ||= File.stat(path())
else
@lstat ||= File.lstat(path())
end
end
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top