FileInfo
import { FileInfo } from "jsr:@ende/fs/unstable-types";interface ยท experimental
interface FileInfoProvides information about a file and is returned by
stat, lstat, statSync,
and lstatSync or from calling stat() and statSync()
on an FsFile instance.
Properties
isFile
isFile: booleanTrue if this is info for a regular file. Mutually exclusive to
FileInfo.isDirectory and FileInfo.isSymlink.
isDirectory
isDirectory: booleanTrue if this is info for a regular directory. Mutually exclusive to
FileInfo.isFile and FileInfo.isSymlink.
isSymlink
isSymlink: booleanTrue if this is info for a symlink. Mutually exclusive to
FileInfo.isFile and FileInfo.isDirectory.
size
size: numberThe size of the file, in bytes.
mtime
mtime: Date | nullThe 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
atime: Date | nullThe 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
birthtime: Date | nullThe 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
dev: numberID of the device containing the file.
ino
ino: number | nullInode number.
Linux/Mac OS only.
mode
mode: number | nullThe underlying raw st_mode bits that contain the standard Unix
permissions for this file/directory.
nlink
nlink: number | nullNumber of hard links pointing to this file.
Linux/Mac OS only.
uid
uid: number | nullUser ID of the owner of this file.
Linux/Mac OS only.
gid
gid: number | nullGroup ID of the owner of this file.
Linux/Mac OS only.
rdev
rdev: number | nullDevice ID of this file.
Linux/Mac OS only.
blksize
blksize: number | nullBlocksize for filesystem I/O.
Linux/Mac OS only.
blocks
blocks: number | nullNumber of blocks allocated to the file, in 512-byte units.
Linux/Mac OS only.
isBlockDevice
isBlockDevice: boolean | nullTrue if this is info for a block device.
Linux/Mac OS only.
isCharDevice
isCharDevice: boolean | nullTrue if this is info for a char device.
Linux/Mac OS only.
isFifo
isFifo: boolean | nullTrue if this is info for a fifo.
Linux/Mac OS only.
isSocket
isSocket: boolean | nullTrue if this is info for a socket.
Linux/Mac OS only.