title: Create a file in a specified directory
body: <p>How can I create a new file in a specific directory. I created this class:</p>
  
  <pre><code>class FileManager
  
      def initialize()
  
      end
  
      def createFile(name,extension)
          return File.new(name &lt;&lt;"."&lt;&lt;extension, "w+")
      end
  end
  </code></pre>
  
  <p>I would like to specify a directory (path) where to create the file. If this one doesn't exist, he will be created. So do I have to use <code>fileutils</code> as shown <a href="https://stackoverflow.com/questions/403239/how-do-i-move-a-file-with-ruby">here</a> just after file creation or can I specify directly in the creation the place where create the file?</p>
  
  <p>Thanks</p>