[#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:02235] Re: Misleading IO error message

From: "Conrad Schneiker" <schneiker@...>
Date: 2000-03-29 03:23:18 UTC
List: ruby-talk #2235
Conrad Schneiker wrote:
> ((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!

Guess I was reading the error message when I typed that. Just in
case it matters in the error-handling code, I should have said:

  But there was such a file!

> 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


In This Thread