Mike Mike - 2 years ago 83
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.

Answer Source

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'.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download