FileExistsQ

FileExistsQ["name"]

gives True if the file with the specified name exists, and gives False otherwise.

Details

Examples

open allclose all

Basic Examples  (2)

Check if a file exists:

In[1]:=
Click for copyable input
Out[1]=

Create a file:

In[1]:=
Click for copyable input

Check if the file exists:

In[2]:=
Click for copyable input
Out[2]=

Delete the file:

In[3]:=
Click for copyable input

Scope  (1)

See Also

FindFile  AbsoluteFileName  DirectoryQ  Put

Introduced in 2008
(7.0)
| Updated in 2016
(11.0)