Two ways
Recommended Method
You can use the functions in the File Utils library, see here to move your files, for example.
mv(src, dest, options = {}) Options: force noop verbose Moves file(s) src to dest. If file and dest exist on the different disk partition, the file is copied instead. FileUtils.mv 'badname.rb', 'goodname.rb' FileUtils.mv 'stuff.rb', '/notexist/lib/ruby', :force => true
Naughty way
Use the backticks approach (run any line as a command)
result = `mv "#{@SOURCE_DIR}/#{my_file} #{@DEST_DIR}/#{file}"`
Well, this is just a variation of calling the system command, but it looks a lot prettier!
Chris mccauley
source share