[#1816] Ruby 1.5.3 under Tru64 (Alpha)? — Clemens Hintze <clemens.hintze@...>

Hi all,

17 messages 2000/03/14

[#1989] English Ruby/Gtk Tutorial? — schneik@...

18 messages 2000/03/17

[#2241] setter() for local variables — ts <decoux@...>

18 messages 2000/03/29

[ruby-talk:02229] Re: Misleading IO error message

From: schneik@...
Date: 2000-03-29 01:11:23 UTC
List: ruby-talk #2229

((I'm resending this because the previous message was automatically
wrapped somewhere along the line at precisely the wrong point
to show my initial problem.))

I got an error message of the following form:

    ./oops.rb:9005:in `open': No such file or
    directory - /w/x/y/z (Errno::ENOENT)

But there was such a directory!

What prevented me from finding the retrospectively obvious error in a
few seconds rather than a few minutes was the fact that the newline
had been stripped from the path name that was displayed in the error
message. It was very deceptive at first. (I did some further
experimentation and found that if you have a space character at the
end of your path, it is not stripped in the error message, but you
could easily overlook what at first just looks like normal
formatting.)

For this sort of error message, would it be possible to print the
actual string with quotes around it?

    ./oops.rb:15:in `open': No such file or
    directory - `/w/x/y/z
    ' (Errno::ENOENT)

Conrad Schneiker
(This note is unofficial and subject to improvement without notice.)


In This Thread

Prev Next