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

Documentation / Mathematica / Built-in Functions / System Interface / File System /

FileNames

FilledSmallSquare FileNames[ ] lists all files in the current working directory.

FilledSmallSquare FileNames["form"] lists all files in the current working directory whose names match the string pattern form.

FilledSmallSquare FileNames["", "", ... ] lists all files whose names match any of the .

FilledSmallSquare FileNames[forms, "", "", ... ] lists files with names matching forms in any of the directories .

FilledSmallSquare FileNames[forms, dirs, n] includes files that are in subdirectories up to n levels down.

FilledSmallSquare The string pattern "form" can contain the metacharacters specified in Section A.3.13.

FilledSmallSquare FileNames["*"] is equivalent to FileNames[ ].

FilledSmallSquare FileNames[forms, dirs, Infinity] looks for files in all subdirectories of the dirs.

FilledSmallSquare The list of files returned by FileNames is sorted in the order generated by the function Sort.

FilledSmallSquare FileNames[forms, dirs, n] includes names of directories only if they appear exactly at level n.

FilledSmallSquare The forms can include relative or absolute directory specifications, in addition to names of files.

FilledSmallSquare Setting the option IgnoreCase -> True makes FileNames treat lower- and upper-case letters in file names as equivalent.

FilledSmallSquare On operating systems such as MS-DOS, FileNames always treats lower- and upper-case letters in file names as equivalent.

FilledSmallSquare See Section 1.11.2 and Section 2.12.4.

FilledSmallSquare See also: Directory, FileType, Get.

FilledSmallSquare Related package: Utilities`Package`.

FilledSmallSquare New in Version 2; modified in 4.0.