This is documentation for Mathematica 6, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)


Updated In 6 Graphic
lists all files in the current working directory.
lists all files in the current working directory whose names match the string pattern form.
FileNames[{form1, form2, ...}]
lists all files whose names match any of the formi.
FileNames[forms, {dir1, dir2, ...}]
lists files with names matching forms in any of the directories diri.
FileNames[forms, dirs, n]
includes files that are in subdirectories up to n levels down.
  • In abbreviated string patterns, * stands for any sequence of zero or more characters. @ stands for any sequence of one or more characters other than upper-case letters.
  • In abbreviated string patterns, Verbatim["s"] specifies that the string "s" should be matched with * and @ treated literally.
  • The list of files returned by FileNames is sorted in the order generated by the function Sort.
  • FileNames[forms, dirs, n] includes names of directories only if they appear exactly at level n.
  • The forms can include relative or absolute directory specifications, in addition to names of files.
  • Setting the option IgnoreCase->True makes FileNames treat lower- and upper-case letters in file names as equivalent.
  • With the default setting IgnoreCase->Automatic, FileNames treats lower- and upper-case letters in file names as equivalent under Microsoft Windows operating systems, but not elsewhere.
New in 2 | Last modified in 6