Title / Description
Code require 'tempfile' file = Tempfile.new('foo') file.path # => A unique filename in the OS's temp directory, # e.g.: "/tmp/foo.24722.0" # This filename contains 'foo' in its basename. This filename contains 'foo' in its basename. This filename contains 'foo' in its basename. This filename contains 'foo' in its basename. This filename contains 'foo' in its basename. This filename contains 'foo' in its basename. This filename contains 'foo' in its basename. This filename contains 'foo' in its basename. This filename contains 'foo' in its basename. file.write("hello world") file.rewind file.read # => "hello world" file.close file.unlink # deletes the temp file
Author
Highlight as C C++ CSS Clojure Delphi ERb Groovy (beta) HAML HTML JSON Java JavaScript PHP Plain text Python Ruby SQL XML YAML diff code