# fs.Stats

A fs.Stats object provides information about a file.

Availability
8.3.0
8.3.0
9.2.0
Extends
Object

NOTE

This is an abstract type. Any object of this structure can be used where this type is used.

# Properties

# atime

Availability
8.3.0
8.3.0
9.2.0
atime :Date

The timestamp indicating the last time this file was accessed.


# atimeMs

Availability
8.3.0
8.3.0
9.2.0
atimeMs :Number

The timestamp indicating the last time this file was accessed expressed in milliseconds since the POSIX Epoch.


# birthtime

Availability
8.3.0
8.3.0
9.2.0
birthtime :Date

The timestamp indicating the creation time of this file.


# birthtimeMs

Availability
8.3.0
8.3.0
9.2.0
birthtimeMs :Number

The timestamp indicating the creation time of this file expressed in milliseconds since the POSIX Epoch.


# blksize

Availability
8.3.0
8.3.0
9.2.0
blksize :Number

The file system block size for i/o operations.

Hard-coded to 4096 on Titanium right now.


# blocks

Availability
8.3.0
8.3.0
9.2.0
blocks :Number

The number of blocks allocated for this file.


# ctime

Availability
8.3.0
8.3.0
9.2.0
ctime :Date

The timestamp indicating the last time the file status was changed.


# ctimeMs

Availability
8.3.0
8.3.0
9.2.0
ctimeMs :Number

The timestamp indicating the last time the file status was changed expressed in milliseconds since the POSIX Epoch.


# dev

Availability
8.3.0
8.3.0
9.2.0
dev :Number

The numeric identifier of the device containing the file.

Always returns 0 on Titanium.


# gid

Availability
8.3.0
8.3.0
9.2.0
gid :Number

The numeric group identifier of the group that owns the file (POSIX).

Always returns 0 on Titanium.


# ino

Availability
8.3.0
8.3.0
9.2.0
ino :Number

The file system specific "Inode" number for the file.

Always returns 0 on Titanium.


# mode

Availability
8.3.0
8.3.0
9.2.0
mode :Number

A bit-field describing the file type and mode.

Always returns 0 on Titanium.


# mtime

Availability
8.3.0
8.3.0
9.2.0
mtime :Date

The timestamp indicating the last time this file was modified.


# mtimeMs

Availability
8.3.0
8.3.0
9.2.0
mtimeMs :Number

The timestamp indicating the last time this file was modified expressed in milliseconds since the POSIX Epoch.


Availability
8.3.0
8.3.0
9.2.0
nlink :Number

The number of hard-links that exist for the file.

Always returns 0 on Titanium.


# rdev

Availability
8.3.0
8.3.0
9.2.0
rdev :Number

A numeric device identifier if the file represents a device.

Always returns 0 on Titanium.


# size

Availability
8.3.0
8.3.0
9.2.0
size :Number

The size of the file in bytes.


# uid

Availability
8.3.0
8.3.0
9.2.0
uid :Number

The numeric user identifier of the user that owns the file (POSIX).

Always returns 0 on Titanium.

# Methods

# isBlockDevice

Availability
8.3.0
8.3.0
9.2.0
isBlockDevice() Boolean

Returns true if the fs.Stats object describes a block device.

Returns

Type
Boolean

# isCharacterDevice

Availability
8.3.0
8.3.0
9.2.0
isCharacterDevice() Boolean

Returns true if the fs.Stats object describes a character device.

Returns

Type
Boolean

# isDirectory

Availability
8.3.0
8.3.0
9.2.0
isDirectory() Boolean

Returns true if the fs.Stats object describes a file system directory.

If the fs.Stats object was obtained from fs.lstat(), this method will always return false. This is because fs.lstat() returns information about a symbolic link itself and not the path it resolves to.

Returns

Type
Boolean

# isFIFO

Availability
8.3.0
8.3.0
9.2.0
isFIFO() Boolean

Returns true if the fs.Stats object describes a first-in-first-out (FIFO) pipe.

Returns

Type
Boolean

# isFile

Availability
8.3.0
8.3.0
9.2.0
isFile() Boolean

Returns true if the fs.Stats object describes a regular file.

Returns

Type
Boolean

# isSocket

Availability
8.3.0
8.3.0
9.2.0
isSocket() Boolean

Returns true if the fs.Stats object describes a socket.

Returns

Type
Boolean

Availability
8.3.0
8.3.0
9.2.0
isSymbolicLink() Boolean

Returns true if the fs.Stats object describes a symbolic link.

This method is only valid when using fs.lstat().

Returns

Type
Boolean