Last active
August 29, 2015 14:09
-
-
Save spidergears/a06f18ddc843627c1cd1 to your computer and use it in GitHub Desktop.
Ruby Tempfile class
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
> tempfile = Tempfile.new(["temp", "text"]) | |
=> #<Tempfile:/tmp/temp20141109-10110-2pjq04text> | |
> tempfile.write("sample tempfile.") | |
=> 16 | |
> tempfile.rewind | |
=> 0 | |
> tempfile.read | |
=> "sample tempfile." | |
> tempfile.close | |
=> nil | |
> tempfile.unlink | |
=> #<Tempfile:> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment