Classes #
Functions #
Changes the permission of a specific file/directory of specified path. Ignores the process's umask.
Synchronously changes the permission of a specific file/directory of specified path. Ignores the process's umask.
Copies the contents and permissions of one file to another specified path, by default creating a new file if needed, else overwriting. Fails if target path is a directory or is unwritable.
Synchronously copies the contents and permissions of one file to another specified path, by default creating a new file if needed, else overwriting. Fails if target path is a directory or is unwritable.
Creates a file if none exists or truncates an existing file and resolves to an instance of Deno.FsFile
.
Creates a file if none exists or truncates an existing file and returns an instance of Deno.FsFile
.
Resolves to a Deno.FileInfo
for the specified path
. If path
is a symlink, information for the symlink will be returned instead of what it points to.
Synchronously returns a Deno.FileInfo
for the specified path
. If path
is a symlink, information for the symlink will be returned instead of what it points to.
Creates a new temporary directory in the default directory for temporary files, unless dir
is specified. Other optional options include prefixing and suffixing the directory name with prefix
and suffix
respectively.
Synchronously creates a new temporary directory in the default directory for temporary files, unless dir
is specified. Other optional options include prefixing and suffixing the directory name with prefix
and suffix
respectively.
Creates a new temporary file in the default directory for temporary files, unless dir
is specified.
Synchronously creates a new temporary file in the default directory for temporary files, unless dir
is specified.
Open a file and resolve to an instance of Deno.FsFile
. The file does not need to previously exist if using the create
or createNew
open options. The caller may have the resulting file automatically closed by the runtime once it's out of scope by declaring the file variable with the using
keyword.
Synchronously open a file and return an instance of Deno.FsFile
. The file does not need to previously exist if using the create
or createNew
open options. The caller may have the resulting file automatically closed by the runtime once it's out of scope by declaring the file variable with the using
keyword.
Reads the directory given by path
and returns an async iterable of Deno.DirEntry
. The order of entries is not guaranteed.
Synchronously reads the directory given by path
and returns an iterable of Deno.DirEntry
. The order of entries is not guaranteed.
Reads and resolves to the entire contents of a file as an array of bytes. TextDecoder
can be used to transform the bytes to string if required. Rejects with an error when reading a directory.
Synchronously reads and returns the entire contents of a file as an array of bytes. TextDecoder
can be used to transform the bytes to string if required. Throws an error when reading a directory.
Asynchronously reads and returns the entire contents of a file as an UTF-8 decoded string. Reading a directory throws an error.
Synchronously reads and returns the entire contents of a file as an UTF-8 decoded string. Reading a directory throws an error.
Renames (moves) oldpath
to newpath
. Paths may be files or directories. If newpath
already exists and is not a directory, rename()
replaces it. OS-specific restrictions may apply when oldpath
and newpath
are in different directories.
Synchronously renames (moves) oldpath
to newpath
. Paths may be files or directories. If newpath
already exists and is not a directory, renameSync()
replaces it. OS-specific restrictions may apply when oldpath
and newpath
are in different directories.
Synchronously returns a Deno.FileInfo
for the specified path
. Will always follow symlinks.
Truncates (or extends) the specified file, to reach the specified len
. If len
is not specified then the entire file contents are truncated.
Synchronously truncates (or extends) the specified file, to reach the specified len
. If len
is not specified then the entire file contents are truncated.
Retrieve the process umask. If mask
is provided, sets the process umask. This call always returns what the umask was before the call.
Changes the access (atime
) and modification (mtime
) times of a file system object referenced by path
. Given times are either in seconds (UNIX epoch time) or as Date
objects.
Synchronously changes the access (atime
) and modification (mtime
) times of a file system object referenced by path
. Given times are either in seconds (UNIX epoch time) or as Date
objects.
Watch for file system events against one or more paths
, which can be files or directories. These paths must exist already. One user action (e.g. touch test.file
) can generate multiple file system events. Likewise, one user action can result in multiple file paths in one event (e.g. mv old_name.txt new_name.txt
).
Write data
to the given path
, by default creating a new file if needed, else overwriting.
Synchronously write data
to the given path
, by default creating a new file if needed, else overwriting.
Write string data
to the given path
, by default creating a new file if needed, else overwriting.
Synchronously write string data
to the given path
, by default creating a new file if needed, else overwriting.
Interfaces #
Information about a directory entry returned from Deno.readDir
and Deno.readDirSync
.
Provides information about a file and is returned by Deno.stat
, Deno.lstat
, Deno.statSync
, and Deno.lstatSync
or from calling stat()
and statSync()
on an Deno.FsFile
instance.
Returned by Deno.watchFs
. It is an async iterator yielding up system events. To stop watching the file system by calling .close()
method.
Options which can be set when using Deno.makeTempDir
, Deno.makeTempDirSync
, Deno.makeTempFile
, and Deno.makeTempFileSync
.
Options which can be set when doing Deno.open
and Deno.openSync
.