Touch Files
Path:
/src/method/touch.coffee
compiled 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
-
options
optional 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
-String
to be changedoptions
-Object
optional see description abovecb
-function(<Error>)
callback withError
if sometzhing went wrong
touchSync()
Usage:
touchSync(file, options)
- Parameter
-
file
-String
to be changedoptions
-Object
optional see description above
- Throws
-
Error
if sometzhing went wrong