Method: Path#touch

Defined in:
lib/path/fileutils.rb

#touchObject

Updates access and modification time or create an empty file.



57
58
59
60
61
62
63
64
65
# File 'lib/path/fileutils.rb', line 57

def touch
  if exist?
    now = Time.now
    File.utime(now, now, @path)
  else
    open('w') {}
  end
  self
end