dir

Returns file list.

Syntax

  • dir
  • dir(dirname)
  • dir(dirname, '-s')
  • res =dir()
  • res = dir(dirname)
  • res = dir(dirname, '-s')

Input argument

  • dirname - a string: file or directory name.
  • '-s' - a string: scan also subdirectories.

Output argument

  • res - a struct with fields: name, date, bytes, isdir, datenum.

Description

dir displays the list of files and folders in the current folder.

* (wildcard) is supported in filename and path name.

Example

res = dir(nelsonroot())
res = dir(nelsonroot(), '-s')

See also

ls, isdir, isfile.

History

VersionDescription
1.0.0initial version

Author

Allan CORNET