Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ (1) — Plan9 3rd Edition (Vita Nuova)

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

sys-stat(2)

FTEST(1)

NAME

ftest − test file attributes

SYNOPSIS

­ftest ­test ­arg

DESCRIPTION

­Ftest checks the specified attribute of ­arg according to ­test and yields an exit status signifying the result.  For all tests apart from -t, ­arg is the name of the file to be tested; for -t, it is the number of a file descriptor.  Available tests are:

­-d True if the file exists and is a directory. 

­-e True if the file exists. 

­-f True if the file exists and is a regular file. 

­-r True if the file exists and is readable. 

­-s True if the file exists and has non-zero size. 

­-t True if the open file represented by the number ­arg represents the same file as /dev/cons. 

­-w True if the file exists and is writable. 

­-x True if the file exists and is executable. 

SOURCE

­/appl/cmd/ftest.b

SEE ALSO

sys-stat(2)

BUGS

­Ftest only works with sh(1) as none of the other Inferno shells can check the exit status of a command.

Checking for read, write and execute capabilities is speculative - the file server has the last say.  Group permissions are ignored. 

Plan 9  —  June 29, 2000

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026