Temp File
Path:
/src/method/tempfile.coffeecompiled to/lib/method/tempfile.js
This will create a new temporary file for you. Like in tempdir()
you may give a specific path and prefix before the numeral file part.
Examples
You may get a file back without doing anything:
CoffeeScript Code fs = require 'alinex-fs'
fs.tempfile (err, dir) ->
console.log "Temporary file is: " + dir
But don’t forget to remove it if no longer needed.
tempfile()
Usage:
tempfile(base, [prefix=process, cb)
- Parameter
-
base-Stringpath under which the directory should be created (usenullto make it in the os default directory)[prefix=process-Stringtitle] to use before numerical partcb-function(<Error>, <String>)callback withErroror the path to the newly created file
tempfileSync()
Usage:
tempfileSync({base=os, [prefix=process)
- Parameter
-
{base=os-Stringsettings} path under which the directory should be created[prefix=process-Stringtitle] to use before numerical part
- Return
Stringthe path to the newly created directory- Throws
-
Errorif something went wrong