How to set the path of a Tempfile in ruby -


I have some files that I want to convert to temphile objects.

Is there a way to do something like this: Tempfile.new (path) ?

I am asking that I am trying to run an imaginary command which creates many files, a single template unfortunately does not collect the newly created files garbage ... < p> Thanks! Instead of just dumping into the new file in temphile, just overwrite it, thinking about just about anything

  tempfile = Tempfile.new ('foo') tempfile.close FileUtils.mv path, tempfile.path tempfile.open    

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -