Dir.tmpdir provides the path to the temporary directory on the current system : tmpdir « File Directory « Ruby






Dir.tmpdir provides the path to the temporary directory on the current system

require 'tmpdir'
puts Dir.tmpdir

 

Related examples in the same category

1.use Dir.tmpdir with File.join to create a platform-independent way of creating a temporary file: