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 reference
  • time - time to use
  • mtime - use this time (defauklts to current time)
  • noCreate - don’t create file if not existing
  • noAccess - don’t change access time of the file
  • noModified - don’t change modified time of the file
  • options optional specific settings like:

    • noCreate - don’t create file if it already exists
    • time - timw to set
    • mtime - modification timw to set
    • reference - use this file’s time
    • noAccess - (boolean) set access time
    • noModified - (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 changed
  • options - Object optional see description above
  • cb - function(<Error>) callback with Error if sometzhing went wrong

touchSync()

Usage:touchSync(file, options)

Parameter
  • file - String to be changed
  • options - Object optional see description above
Throws
  • Error if sometzhing went wrong