Why not using filename directly? Please look at http://www.ruby-doc.org/core-2.1.1/File.html