link-info ( path -- info ) (original) (raw)

link-info ( path -- info )
Factor handbook » Input and output » File system metadata

Prev: file-info ( path -- info )
Next: file-exists? ( path -- ? )

Vocabulary
io.files.info

Inputs

path a pathname string

Outputs

info a file-info-tuple

Word description
Queries the file system for metadata. If path refers to a symbolic link, information about the symbolic link itself is returned. See the article File types for a list of metadata symbols.

Errors
Throws an error if the file does not exist.

See also
file-info, file-info-tuple

Definition

USING: system ;

IN: io.files.info

HOOK: link-info os ( path -- info )

Methods

USING: io.backend io.files.info io.files.info.unix system
unix.stat ;

M: unix link-info normalize-path link-status stat>file-info ;