Version: v0.7.1 - Beta.  We welcome contributors & feedback.


File.touch($path, $date = now, $flags = {}) -> false


Update the modifyDate and accessDate of a file.

If the file does not exist, it will be created with no content.

The $path is relative to the data/files directory.

The $date must be a Date object.

File.touch('file.txt')  // now

File.touch('file.txt', Date.create('5 minutes ago'))


Option Value Description
stat access, modify, both The timestamp stat to update. (Default: 'both')
File.touch('file.txt',, { stat: 'access' })

See Also