irb(main):001:0> Errno::EACCES.new.errno
=> 13
irb(main):002:0> SystemCallError.new 13
=> #<SystemCallError: Unknown error 13>
This is with jruby 1.4.0RC1 (ruby 1.8.7 patchlevel 174) (2009-09-30
80c263b) (OpenJDK Client VM 1.6.0_0) [i386-java]
Compare to MRI:
irb(main):001:0> Errno::EACCES.new.errno
=> 13
irb(main):002:0> SystemCallError.new 13
=> #<Errno::EACCES: Permission denied>
-Justin
--
Posted via http://www.ruby-forum.com/.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
Yup, looks like our SystemCallError is only accepting strings. You
should file a bug, and see if there's a spec for this you can add to
Rubyspec (www.rubyspec.org).
- Charlie
On Thu, Oct 8, 2009 at 10:43 PM, Charles Oliver Nutter
<hea...@headius.com> wrote:
> On Wed, Oct 7, 2009 at 1:11 PM, Justin Collins <li...@ruby-forum.com> wrote:
>> SystemCallError.new is supposed to create a new instance of the
>> appropriate Errno class based on the errno given. However, there seems
>> to be some problem:
>>
>> irb(main):001:0> Errno::EACCES.new.errno
>> => 13
>> irb(main):002:0> SystemCallError.new 13
>> => #<SystemCallError: Unknown error 13>
>
> Yup, looks like our SystemCallError is only accepting strings. You
> should file a bug, and see if there's a spec for this you can add to
> Rubyspec (www.rubyspec.org).
Actually, SystemCallError does accept string and numeric values. What
it doesn't do it doesn't convert bare SystemCallError to proper Errno
when it should. I'll take a look and see what we can do here. I think
we have everything in place, including the platform-dependent
errno-values from Constantine project (which was a big problem in the
past), so we just need to wire this stuff up.
Justin, could you please file a JIRA issue for this, if you can?
Thanks,
--Vladimir
Аh, sorry, you've already filed: http://jira.codehaus.org/browse/JRUBY-4071
Will fix.
On Wed, Oct 7, 2009 at 9:11 PM, Justin Collins <li...@ruby-forum.com> wrote:
> SystemCallError.new is supposed to create a new instance of the
> appropriate Errno class based on the errno given.
The issue has been fixed in 10e567b on master (1.5dev) branch.
Please take a look and verify. ;) Small Rubyspec test also has been added.
Thanks,
--Vladimir
Looks like it is working to me. Thanks, now my lib passes all the tests
:)
-Justin
--
Posted via http://www.ruby-forum.com/.
---------------------------------------------------------------------