fileTouch

Updates a file's last modified date, creating the file if it doesn't exist.

fileTouch(file [, createPath]) → returns void

This function requires Lucee.  Not supported on Adobe ColdFusion, etc.

Argument Reference

file any
Required

The path of the file, or a file object.

createPath boolean
Default: false

When true, missing parent directories are created. Lucee's docs give the default as true, but a missing parent directory throws an error unless this is true.

Examples
Sample code invoking the fileTouch function

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub