Ben Hall
2008-Oct-06 22:14 UTC
[Ironruby-core] Expand_Path - Errors when path contains line number
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
Tomas Matousek
2008-Oct-06 22:21 UTC
[Ironruby-core] Expand_Path - Errors when path contains line number
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 -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ben Hall Sent: Monday, October 06, 2008 3:14 PM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] Expand_Path - Errors when path contains line number 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 _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core
Ben Hall
2008-Oct-06 22:36 UTC
[Ironruby-core] Expand_Path - Errors when path contains line number
Done http://rubyforge.org/tracker/index.php?func=detail&aid=22315&group_id=4359&atid=16798 Cheers Ben On Mon, Oct 6, 2008 at 11:21 PM, Tomas Matousek <Tomas.Matousek at microsoft.com> wrote:> 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 > > -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ben Hall > Sent: Monday, October 06, 2008 3:14 PM > To: ironruby-core at rubyforge.org > Subject: [Ironruby-core] Expand_Path - Errors when path contains line number > > 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 > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core >