Skip to content

Instantly share code, notes, and snippets.

@gioele
Created October 6, 2009 15:26
Show Gist options
  • Save gioele/203117 to your computer and use it in GitHub Desktop.
Save gioele/203117 to your computer and use it in GitHub Desktop.
$ ruby no-close.rb
$ cat foobar
hi
$
$ ~/jruby-1.3.1 no-close.rb
$ cat foobar
$
Without 'out.close' jruby does not write anything to the file.
out = File.new('foobar', 'w')
out.write('hi')
out.puts
# even with no "out.close" I expect this file to contain "hi\n" at the end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment