Mike Mike - 5 months ago 8x
Ruby Question

What is the best way to get an empty temporary directory in Ruby on Rails?

What is the best way to get a temporary directory with nothing in it using Ruby on Rails? I need the API to be cross-platform compatible. The stdlib tmpdir won't work.


The Dir#tmpdir function in the Ruby core (not stdlib that you linked to) should be cross-platform.

To use this function you need to require 'tmpdir'.