W
Witold Rugowski
Hi!
I've been stuck with simple thing - I'm trying to change dir into not
existant directory. I'm using following code:
dir="no_such_one"
begin
Dir.chdir(dir)
rescue
into_dir = false; #we didn't make it
end
And resuce does not catch this:
Exception `Errno::ENOENT' at ./test.rb:33 - No such file or directory -
no_such_one
But Errno::ENOENT is child of StandardError, which should be catched by
default. So I'm probably making some stupid mistake - but I can not find
what one. Could someone help me?
I've been stuck with simple thing - I'm trying to change dir into not
existant directory. I'm using following code:
dir="no_such_one"
begin
Dir.chdir(dir)
rescue
into_dir = false; #we didn't make it
end
And resuce does not catch this:
Exception `Errno::ENOENT' at ./test.rb:33 - No such file or directory -
no_such_one
But Errno::ENOENT is child of StandardError, which should be catched by
default. So I'm probably making some stupid mistake - but I can not find
what one. Could someone help me?