[Ironruby-core] Errno::ENOENT and %x[..]

Daniele Alessandri suppakilla at gmail.com
Sun Jun 15 05:52:58 EDT 2008


Hi,

Last month, in my spare time, I have started to implement Process::Status
and the related methods Kernel#system, Kernel#exec and %x[..]. While trying
to solve a few design issues on my side, I noticed that %x[..] behaves like
Kernel#exec in that they both throw exceptions:

ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]

irb(main):001:0> system "doesnotexist"
=> false
irb(main):002:0> exec "doesnotexist"
Errno::ENOENT: No such file or directory - doesnotexist
        from (irb):2:in `exec'
        from (irb):2
irb(main):003:0> %x[doesnotexist]
Errno::ENOENT: No such file or directory - doesnotexist
        from (irb):3:in ``'
        from (irb):3
irb(main):004:0>

Now the problem is that the implementation of %x[..] is in the Ruby project
(more precisely, in the static method ExecuteCommand of RubyOps)
while the NoEntryError exception (Errno::ENOENT) is defined in the
IronRuby.Libraries project and thus not accessible AFAIK.

Any ideas on how to work around this?

-- 
Daniele Alessandri
http://www.clorophilla.net/blog/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20080615/8c6cb6f3/attachment-0001.html>


More information about the Ironruby-core mailing list