def create_tempdir
      token = loop do
        # generate random dirnames until we find one that
        # doesn't exist
        test_token = SecureRandom.hex
        break test_token unless File.exist? test_token
      end
      Dir.mkdir(token)
      @last_tempdir = token
      token
    end
def create_tempdir
      token = loop do
        # generate random dirnames until we find one that
        # doesn't exist
        test_token = SecureRandom.hex
        break test_token unless File.exist? test_token
      end
      Dir.mkdir(token)
      @last_tempdir = token
      token
    end
create a guaranteed random temporary directory for storing outputs
 return the dirname