Forum: IronRuby Expand_Path - Errors when path contains line number

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
D4ced0fe3718f187173fc05dd7f33f57?d=identicon&s=25 Ben Hall (Guest)
on 2008-10-07 00:16
(Received via mailing list)
Hi,

When using FileOps.ExpandPath() (otherwise known as File.expand_path),
I think the method should accept a path which includes additional
information - such as the line number :
../../path/folder/file.rb:93

Should return
E:/IronRuby/r156/path/folder/file.rb:93

However, i've found that it actually throws an exception:
E:\IronRuby\r156\src\IronRuby.Libraries\Builtins\FileOps.cs:358:in
`expand_path': Invalid argument - ../../path/folder/file.rb:93
(Errno::EINVAL)

I'm getting the path by calling:
caller(0)[1]

Is this right? Or has something else gone wrong?

Thanks

Ben
Cb51033949ffccd982ae32c9f890f25a?d=identicon&s=25 Tomas Matousek (Guest)
on 2008-10-07 00:24
(Received via mailing list)
The problem is that ':' is a special character used for delimiting drive
name on Windows. Currently, we use .NET file API for expand_path
implementation. Maybe we should use string manipulation only. Can you
file a bug?

Tomas
D4ced0fe3718f187173fc05dd7f33f57?d=identicon&s=25 Ben Hall (Guest)
on 2008-10-07 00:58
(Received via mailing list)
Done

http://rubyforge.org/tracker/index.php?func=detail...

Cheers

Ben

On Mon, Oct 6, 2008 at 11:21 PM, Tomas Matousek
This topic is locked and can not be replied to.