Touch Files
Path:
/src/method/touch.coffeecompiled to/lib/method/touch.js
The touch methods allow the following options:
reference- file path used as referencetime- time to usemtime- use this time (defauklts to current time)noCreate- don’t create file if not existingnoAccess- don’t change access time of the filenoModified- don’t change modified time of the file
-
optionsoptional specific settings like:noCreate- don’t create file if it already existstime- timw to setmtime- modification timw to setreference- use this file’s timenoAccess- (boolean) set access timenoModified- (boolean) set modified time`
Example:
CoffeeScript Code fs = require 'alinex-fs'
fs.touch "/tmp/testfile", (err) ->
# everything done, go on
CoffeeScript Code fs = require 'alinex-fs'
fs.touch "/tmp/testfile",
noCreate: true
, (err) ->
# everything done, go on
touch()
Usage:
touch(file, options, cb)
- Parameter
-
file-Stringto be changedoptions-Objectoptional see description abovecb-function(<Error>)callback withErrorif sometzhing went wrong
touchSync()
Usage:
touchSync(file, options)
- Parameter
-
file-Stringto be changedoptions-Objectoptional see description above
- Throws
-
Errorif sometzhing went wrong