Skip to content

Instantly share code, notes, and snippets.

@mcamou
Created May 25, 2011 11:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcamou/990811 to your computer and use it in GitHub Desktop.
Save mcamou/990811 to your computer and use it in GitHub Desktop.
$ ruby --version
ruby 1.8.7 (2011-02-18 patchlevel 334) [i686-darwin10]
$ irb
irb(main):001:0> f = File.new("/tmp/x")
=> #<File:/tmp/x>
irb(main):002:0> f.flock(File::LOCK_EX)
=> 0
$ java -jar jruby-complete-1.6.2.jar -S irb
irb(main):001:0> f = File.new("/tmp/x")
=> #<File:/tmp/x>
irb(main):002:0> f.flock(File::LOCK_EX)
Errno::EBADF: Bad file descriptor - cannot acquire exclusive lock on File not opened for write
from org/jruby/RubyFile.java:341:in `flock'
from (irb):2:in `evaluate'
from org/jruby/RubyKernel.java:1088:in `eval'
from file:/Users/mario/.m2/repository/org/jruby/jruby-complete/1.6.2/jruby-complete-1.6.2.jar!/META-INF/jruby.home/lib/ruby/1.8/irb.rb:158:in `eval_input'
from file:/Users/mario/.m2/repository/org/jruby/jruby-complete/1.6.2/jruby-complete-1.6.2.jar!/META-INF/jruby.home/lib/ruby/1.8/irb.rb:271:in `signal_status'
from file:/Users/mario/.m2/repository/org/jruby/jruby-complete/1.6.2/jruby-complete-1.6.2.jar!/META-INF/jruby.home/lib/ruby/1.8/irb.rb:155:in `eval_input'
from org/jruby/RubyKernel.java:1419:in `loop'
from org/jruby/RubyKernel.java:1191:in `catch'
from file:/Users/mario/.m2/repository/org/jruby/jruby-complete/1.6.2/jruby-complete-1.6.2.jar!/META-INF/jruby.home/lib/ruby/1.8/irb.rb:154:in `eval_input'
from file:/Users/mario/.m2/repository/org/jruby/jruby-complete/1.6.2/jruby-complete-1.6.2.jar!/META-INF/jruby.home/lib/ruby/1.8/irb.rb:71:in `start'
from org/jruby/RubyKernel.java:1191:in `catch'
from file:/Users/mario/.m2/repository/org/jruby/jruby-complete/1.6.2/jruby-complete-1.6.2.jar!/META-INF/jruby.home/lib/ruby/1.8/irb.rb:70:in `start'
from file:/Users/mario/.m2/repository/org/jruby/jruby-complete/1.6.2/jruby-complete-1.6.2.jar!/META-INF/jruby.home/bin/jirb:13:in `(root)'
from org/jruby/RubyKernel.java:1063:in `load'
from file:/Users/mario/.m2/repository/org/jruby/jruby-complete/1.6.2/jruby-complete-1.6.2.jar!/META-INF/jruby.home/bin/jirb:12:in `jirb'
from org/jruby/RubyProc.java:268:in `call'
from jirb:1:in `(root)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment