Function File: ex = fexist (file, tspec, aspec)

Checks whether a file exists. file is the queried file path. tspec is a combination of letters f,d,p,S, corresponding to file types:

  • f: regular file
  • d: directory
  • p: named pipe (FIFO special file)
  • S: socket

The query is true if the actual file type matches any of the specified options.

aspec is a combination of letters r,w,x, corresponding to queried access privileges to the file. The query is true if the current user has all the specified types of access, either through "user", "group" or "other" specs.

See also: stat, lstat.

Package: io