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 > Directories & Directory Operations >

DirectoryQ

DirectoryQ["name"]
gives True if the directory with the specified name exists, and gives False otherwise.
  • In DirectoryQ["name"], name is interpreted relative to your current directory.
Check if the name corresponds to a directory:
The result is False if the file is not a directory or does not exist:
Check if the name corresponds to a directory:
In[1]:=
Click for copyable input
Out[1]=
 
The result is False if the file is not a directory or does not exist:
In[1]:=
Click for copyable input
Out[1]=
New in 7
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team