converts Date or number to a fractional UNIX timestamp Grabbed from NodeJS sources (lib/fs.js)
Asynchronously append data to a file, creating the file if it not yet exists.
Asynchronously append data to a file, creating the file if it not yet exists.
Asynchronous chmod
.
Synchronous chmod
.
Asynchronous chown
.
Synchronous chown
.
Asynchronous close.
Synchronous close.
Test whether or not the given path exists by checking with the file system. Then call the callback argument with either true or false.
Test whether or not the given path exists by checking with the file system.
Asynchronous fchmod
.
Synchronous fchmod
.
Asynchronous fchown
.
Synchronous fchown
.
Asynchronous fdatasync.
Synchronous fdatasync.
Asynchronous fstat
.
fstat()
is identical to stat()
, except that the file to be stat-ed is
specified by the file descriptor fd
.
Synchronous fstat
.
fstat()
is identical to stat()
, except that the file to be stat-ed is
specified by the file descriptor fd
.
Asynchronous fsync.
Synchronous fsync.
Asynchronous ftruncate.
Synchronous ftruncate.
Change the file timestamps of a file referenced by the supplied file descriptor.
Change the file timestamps of a file referenced by the supplied file descriptor.
NONSTANDARD: Grab the FileSystem instance that backs this API.
Returns null if the file system has not been initialized.
Asynchronous lchmod
.
Synchronous lchmod
.
Asynchronous lchown
.
Synchronous lchown
.
Asynchronous link
.
Synchronous link
.
Asynchronous lstat
.
lstat()
is identical to stat()
, except that if path is a symbolic link,
then the link itself is stat-ed, not the file that it refers to.
Synchronous lstat
.
lstat()
is identical to stat()
, except that if path is a symbolic link,
then the link itself is stat-ed, not the file that it refers to.
Asynchronous mkdir
.
defaults to 0777
Synchronous mkdir
.
defaults to 0777
Asynchronous file open. Exclusive mode ensures that path is newly created.
flags
can be:
'r'
- Open file for reading. An exception occurs if the file does not exist.'r+'
- Open file for reading and writing. An exception occurs if the file does not exist.'rs'
- Open file for reading in synchronous mode. Instructs the filesystem to not cache writes.'rs+'
- Open file for reading and writing, and opens the file in synchronous mode.'w'
- Open file for writing. The file is created (if it does not exist) or truncated (if it exists).'wx'
- Like 'w' but opens the file in exclusive mode.'w+'
- Open file for reading and writing. The file is created (if it does not exist) or truncated (if it exists).'wx+'
- Like 'w+' but opens the file in exclusive mode.'a'
- Open file for appending. The file is created if it does not exist.'ax'
- Like 'a' but opens the file in exclusive mode.'a+'
- Open file for reading and appending. The file is created if it does not exist.'ax+'
- Like 'a+' but opens the file in exclusive mode.Synchronous file open.
defaults to 0644
Read data from the file specified by fd
.
An integer specifying the number of bytes to read.
An integer specifying where to begin reading from in the file. If position is null, data will be read from the current file position.
Asynchronously reads the entire contents of a file.
Synchronously reads the entire contents of a file.
Read data from the file specified by fd
.
An integer specifying the number of bytes to read.
An integer specifying where to begin reading from in the file. If position is null, data will be read from the current file position.
Asynchronous readdir
. Reads the contents of a directory.
The callback gets two arguments (err, files)
where files
is an array of
the names of the files in the directory excluding '.'
and '..'
.
Synchronous readdir
. Reads the contents of a directory.
Asynchronous readlink.
Synchronous readlink.
Asynchronous realpath
. The callback gets two arguments
(err, resolvedPath)
. May use process.cwd
to resolve relative paths.
Synchronous realpath
.
An object literal of mapped paths that can be used to
force a specific path resolution or avoid additional fs.stat
calls for
known real paths.
Asynchronous rename. No arguments other than a possible exception are given to the completion callback.
Synchronous rename.
Asynchronous rmdir
.
Synchronous rmdir
.
Asynchronous stat
.
Synchronous stat
.
Asynchronous symlink
.
Synchronous symlink
.
can be either 'dir'
or 'file'
(default is 'file'
)
Asynchronous truncate
.
Synchronous truncate
.
Asynchronous unlink
.
Synchronous unlink
.
Change file timestamps of the file referenced by the supplied path.
Change file timestamps of the file referenced by the supplied path.
For unit testing. Passes all incoming callbacks to cbWrapper for wrapping.
Write buffer to the file specified by fd
.
Note that it is unsafe to use fs.write multiple times on the same file
without waiting for the callback.
Buffer containing the data to write to the file.
Offset in the buffer to start reading data from.
The amount of bytes to write to the file.
Asynchronously writes data to a file, replacing the file if it already exists.
The encoding option is ignored if data is a buffer.
Synchronously writes data to a file, replacing the file if it already exists.
The encoding option is ignored if data is a buffer.
Write buffer to the file specified by fd
.
Note that it is unsafe to use fs.write multiple times on the same file
without waiting for it to return.
Buffer containing the data to write to the file.
Offset in the buffer to start reading data from.
The amount of bytes to write to the file.
Offset from the beginning of the file where this data should be written. If position is null, the data will be written at the current position.
Generated using TypeDoc
The node frontend to all filesystems. This layer handles:
setImmediate
.http://nodejs.org/api/fs.html