You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Daniel Berger edited this page Nov 30, 2021
·
5 revisions
Description
The file-temp library is an alternate way to handle tempfile generation.
Installation
gem install file-temp
Requirements
ffi 1.0.0 or later
Synopsis
require'file/temp'fh=File::Temp.newfh.puts"hello"fh.close# => Tempfile automatically deletedfh=File::Temp.new(delete: false)fh.puts"world"fh.close# => Tempfile still on your filesystem
Other possible constructor options are:
directory: - Explicitly specify which directory you want to use instead of TMPDIR.
options: - options hash passed directly to the File.open constructor.
template: - A template for the tempfile name. The default is "rb_file_temp_XXXXXX".