Display file listing for directory directory.
If directory is not specified then list the present working directory.
If a return value is requested, return a structure array with the fields
File or directory name.
Timestamp of file modification (string value).
File size in bytes.
True if name is a directory.
Timestamp of file modification as serial date number (double).
Information structure returned from stat
.
If directory is a filename, rather than a directory, then return information about the named file. directory may also be a list rather than a single directory or file.
directory is subject to shell expansion if it contains any wildcard characters ‘*’, ‘?’, ‘[]’. To find a literal example of a wildcard character the wildcard must be escaped using the backslash operator ‘\’.
Note that for symbolic links, dir
returns information about the
file that the symbolic link points to rather than the link itself.
However, if the link points to a nonexistent file, dir
returns
information about the link.
See also: ls, readdir, glob, what, stat, lstat.
Package: octave