diff options
Diffstat (limited to 'cli/js/stat.ts')
-rw-r--r-- | cli/js/stat.ts | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/cli/js/stat.ts b/cli/js/stat.ts index e742451fd..ea4ab1014 100644 --- a/cli/js/stat.ts +++ b/cli/js/stat.ts @@ -23,12 +23,13 @@ export interface StatResponse { blocks: number; } -/** Queries the file system for information on the path provided. If the given - * path is a symlink information about the symlink will be returned. +/** Resolves to a `Deno.FileInfo` for the specified path. If path is a + * symlink, information for the symlink will be returned. * * const fileInfo = await Deno.lstat("hello.txt"); * assert(fileInfo.isFile()); - */ + * + * Requires `allow-read` permission. */ export async function lstat(filename: string): Promise<FileInfo> { const res = (await sendAsync("op_stat", { filename, @@ -37,13 +38,13 @@ export async function lstat(filename: string): Promise<FileInfo> { return new FileInfoImpl(res); } -/** Queries the file system for information on the path provided synchronously. - * If the given path is a symlink information about the symlink will be - * returned. +/** Synchronously returns a `Deno.FileInfo` for the specified path. If + * path is a symlink, information for the symlink will be returned. * * const fileInfo = Deno.lstatSync("hello.txt"); * assert(fileInfo.isFile()); - */ + * + * Requires `allow-read` permission. */ export function lstatSync(filename: string): FileInfo { const res = sendSync("op_stat", { filename, @@ -52,12 +53,13 @@ export function lstatSync(filename: string): FileInfo { return new FileInfoImpl(res); } -/** Queries the file system for information on the path provided. `stat` Will - * always follow symlinks. +/** Resolves to a `Deno.FileInfo` for the specified path. Will always follow + * symlinks. * * const fileInfo = await Deno.stat("hello.txt"); * assert(fileInfo.isFile()); - */ + * + * Requires `allow-read` permission. */ export async function stat(filename: string): Promise<FileInfo> { const res = (await sendAsync("op_stat", { filename, @@ -66,12 +68,13 @@ export async function stat(filename: string): Promise<FileInfo> { return new FileInfoImpl(res); } -/** Queries the file system for information on the path provided synchronously. - * `statSync` Will always follow symlinks. +/** Synchronously returns a `Deno.FileInfo` for the specified path. Will + * always follow symlinks. * * const fileInfo = Deno.statSync("hello.txt"); * assert(fileInfo.isFile()); - */ + * + * Requires `allow-read` permission. */ export function statSync(filename: string): FileInfo { const res = sendSync("op_stat", { filename, |