Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/deno/cli/tsc/dts/lib.deno.ns.d.ts>Deno.FileInfo

A modern runtime for JavaScript and TypeScript.
Go to Latest
interface Deno.FileInfo
import { type Deno } from "https://deno.land/x/deno@v1.28.3/cli/tsc/dts/lib.deno.ns.d.ts";
const { FileInfo } = Deno;

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.

Properties

isFile: boolean

True if this is info for a regular file. Mutually exclusive to FileInfo.isDirectory and FileInfo.isSymlink.

isDirectory: boolean

True if this is info for a regular directory. Mutually exclusive to FileInfo.isFile and FileInfo.isSymlink.

size: number

The size of the file, in bytes.

mtime: Date | null

The last modification time of the file. This corresponds to the mtime field from stat on Linux/Mac OS and ftLastWriteTime on Windows. This may not be available on all platforms.

atime: Date | null

The last access time of the file. This corresponds to the atime field from stat on Unix and ftLastAccessTime on Windows. This may not be available on all platforms.

birthtime: Date | null

The creation time of the file. This corresponds to the birthtime field from stat on Mac/BSD and ftCreationTime on Windows. This may not be available on all platforms.

dev: number | null

ID of the device containing the file.

Linux/Mac OS only.

ino: number | null

Inode number.

Linux/Mac OS only.

mode: number | null

UNSTABLE: Match behavior with Go on Windows for mode.

The underlying raw st_mode bits that contain the standard Unix permissions for this file/directory.

uid: number | null

User ID of the owner of this file.

Linux/Mac OS only.

gid: number | null

Group ID of the owner of this file.

Linux/Mac OS only.

rdev: number | null

Device ID of this file.

Linux/Mac OS only.

blksize: number | null

Blocksize for filesystem I/O.

Linux/Mac OS only.

blocks: number | null

Number of blocks allocated to the file, in 512-byte units.

Linux/Mac OS only.