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) -

c# - passing input text from view to contoller with FacebookContext using Facebook app -

Calling a C++ function from C# by passing a string with variable size to it -