$ cat repro.rb
File.open('/dev/nst5', 'w')
innocent enough (/dev/nst5 is a scsi tape device)
succeeds with MRI:
$ sudo java -jar jruby-complete-1.7.0.preview1.jar repro.rb
IOError: Invalid argument
initialize at org/jruby/RubyFile.java:315
open at org/jruby/RubyIO.java:1109
(root) at repro.rb:1
succeeds with MRI:
pac...@app001.app.prod.dps:~/temp$ sudo ~/installs/bin/ruby -v repro.rb
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
$
Test: is this a recent change to jruby?
$ sudo java -jar ~/jruby-complete-1.5.0.jar repro.rb
repro.rb:1:in `initialize': Invalid argument (IOError)
from repro.rb:1:in `open'
from repro.rb:1
Doesn't appear so. The device doesn't like the way it's trying to open, for some reason, (mode "w" or "wb" same thing, "r" mode seems to open the descriptor all right). "normal java" classes using standard filewriters can open ok [1], so I presume it's some type of jruby thing. Sorry this one's a bit difficult to test, but I'd be happy to try anything given.
[1] https://gist.github.com/2937606
|