touch

  • Ruby’s File class does not have an equivalent of PHP’s touch function. However, you can use FileUtils from the Ruby Standard Library to a touch file.

    PHP

    touch('/path/to/foobar');

    Ruby

    require 'fileutils'
     
    FileUtils.touch '/path/to/foobar'
tmpfile trim

Looking for Rails or PHP web application development, integration, and training?

Rails for PHP is brought to you by Maintainable Software. Get custom web applications and personalized training from the authors of the book and website.