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

后端 未结 9 554

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.

9条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2020-12-28 13:24

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

提交回复
热议问题