Mike Perham

On Ruby, software and the Internet

Touch a File

February 27th, 2010 · 1 Comment

Here’s how to touch a file using Ruby, easy as 1-2-3:

  File.utime(access_time, mod_time, filename)

Tags: Ruby

1 response so far ↓

  • 1 Michael Xavier // Apr 30, 2010 at 10:21 am

    Any reason why this is preferable to FileUtils.touch?

Leave a Comment