All Manuals > LispWorks® User Guide and Reference Manual > 47 The SYSTEM Package

get-file-stat Function

Summary

Provides read access to the C stat structure which describes files.

Package

system

Signature

get-file-stat filename-or-fd => file-stat, errno

Arguments
filename-or-fd
A string denoting a file, or a file descriptor.
Values
file-stat
On success, an object representing the stat values, otherwise nil.
errno
On failure, indicates the errno value returned by the system call.
Description

The function get-file-stat returns an object representing the stat values associated with filename-or-fd, as would be returned by the system call stat (for a filename) or the system call fstat (for an fd). It is not applicable on Microsoft Windows.

The values in file-stat are the raw data, and it is the responsibility of the user to interpret them when needed. See the POSIX manual entry for stat for details.

On failure, nil is returned as the first value file-stat and the second value errno is the errno from the system call.

The values can be read from file-stat by these readers:

sys:file-stat-inode

The inode of the file.

sys:file-stat-device

The id of the device where the file is.

sys:file-stat-owner-id

The user id of the owner of the file.

sys:file-stat-group-id

The group id of the file's group.

sys:file-stat-size

The size of the file in bytes.

sys:file-stat-blocks

The number of 512-bytes blocks used by the file.

sys:file-stat-mode

The protection value of the file.

sys:file-stat-last-access

The time of the last access to the file in seconds from 1 January 1970.

sys:file-stat-last-change

The time of the last change in the data of the file in seconds from 1 January 1970.

sys:file-stat-last-modify

The time of the last modification of the file status in seconds from 1 January 1970.

sys:file-stat-links

The number of hard links to the file.

sys:file-stat-device-type

The device type (sometimes called Rdev).


LispWorks® User Guide and Reference Manual - 01 Dec 2021 19:31:02