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

x/deno/cli/js/file_info.ts>FileInfo

A modern runtime for JavaScript and TypeScript.
Go to Latest
interface FileInfo
import { type FileInfo } from "https://deno.land/x/deno@v0.28.0/cli/js/file_info.ts";

A FileInfo describes a file and is returned by stat, lstat, statSync, lstatSync.

Properties

len: number

The size of the file, in bytes.

modified: number | null

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

accessed: number | 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.

created: number | null

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

mode: number | null

The underlying raw st_mode bits that contain the standard Unix permissions for this file/directory. TODO Match behavior with Go on windows for mode.

name: string | null

The file or directory name.

Methods

isFile(): boolean

Returns whether this is info for a regular file. This result is mutually exclusive to FileInfo.isDirectory and FileInfo.isSymlink.

isDirectory(): boolean

Returns whether this is info for a regular directory. This result is mutually exclusive to FileInfo.isFile and FileInfo.isSymlink.