- Scilab help
- Files : Input/Output functions
- basename
- chdir
- copyfile
- createdir
- deletefile
- dir
- dirname
- dispfiles
- fileext
- fileinfo
- fileparts
- filesep
- findfiles
- fprintf
- fprintfMat
- fscanf
- fscanfMat
- fullfile
- fullpath
- get_absolute_file_path
- getdrives
- getlongpathname
- getrelativefilename
- getshortpathname
- %io
- isdir
- isfile
- listfiles
- listvarinfile
- ls
- maxfiles
- mclearerr
- mclose
- mdelete
- meof
- merror
- mfprintf
- mscanf
- mget
- mgetl
- mgetstr
- mkdir
- mopen
- movefile
- mput
- mputl
- mputstr
- mseek
- mtell
- newest
- pathconvert
- pathsep
- pwd
- removedir
- rmdir
- save_format
- scanf
- scanf_conversion
- sscanf
Please note that the recommended version of Scilab is 2026.0.0. This page might be outdated.
See the recommended documentation of this function
dir
get file list
Calling Sequence
dir path S=dir([path])
Arguments
- path
- a string matrix giving a directory pathname (eventually ended by a pattern built with - *). Default value is- .
- S
- a - tlistof type- dirwith fields :- name,- date,- bytesand- isdir
Description
dir can be used to get the files which match 
      the patterns given by the path argument. 
      Patterns are given to the unix ls or to the windows
      dir commands in order to get information on files. 
      Thus in order to write portable Scilab script valid wildcard patterns 
      for both os are to be given. Note that Pathname conversion is
      performed and for example SCI/modules/core/macros/*.sci is a valid pattern for both unix and windows.
The name field of the returned variable is the column vector
      of the file names.
The date field of the returned variable is the column vector
      of integers containing a last modification date coded in second from 1 Jan 1970.
The bytes field of the returned variable is the column vector
      of integers containing the size of the files in bytes.
The isdir field of the returned variable is the column vector
      of boolean true if the corresponding name is a directory.
The default display of the returned structure is a column formatted list
      of files. It can be changed redefining the function %dir_p
Since Scilab 5.3.1, a trailing "/" or "\" (See filesep) is displayed for each directory.
Examples
See Also
| << deletefile | Files : Input/Output functions | dirname >> |