Created
October 6, 2009 15:26
-
-
Save gioele/203117 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ruby no-close.rb | |
$ cat foobar | |
hi | |
$ | |
$ ~/jruby-1.3.1 no-close.rb | |
$ cat foobar | |
$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Without 'out.close' jruby does not write anything to the file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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