Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Systems Interfaces & Deployment > File Operations > FileNames >

FileNames

FileNames
lists all files in the current working directory.
FileNames[form]
lists all files in the current working directory whose names match the string pattern form.
FileNames
lists all files whose names match any of the .
FileNames
lists files with names matching forms in any of the directories .
FileNames
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 uppercase letters.
  • In abbreviated string patterns, Verbatim specifies that the string 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 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 lowercase and uppercase letters in file names as equivalent.
  • With the default setting IgnoreCase->Automatic, FileNames treats lowercase and uppercase letters in file names as equivalent under Microsoft Windows operating systems, but not elsewhere.
List the file and directory names in the $InstallationDirectory:
Count the files in the whole installation directory:
List the file and directory names in the $InstallationDirectory:
In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=
Count the files in the whole installation directory:
In[3]:=
Click for copyable input
Out[3]=
New in 2 | Last modified in 6
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF