FileExistsQ
✖
FileExistsQ
✖
FileExistsQ["name"]
gives True if the file with the specified name exists, and gives False otherwise.
Details

- In FileExistsQ["name"], name is interpreted relative to your current directory.
- FileExistsQ does not search $Path.
- FileExistsQ tests for files, directories, or any other filesystem objects.
- FileExistsQ[File["file"]] is also supported
Examples
open allclose allBasic Examples (2)Summary of the most common use cases
In[1]:=1

✖
https://wolfram.com/xid/0h2kt4vkeb-erybo0
Out[1]=1

In[1]:=1

✖
https://wolfram.com/xid/0h2kt4vkeb-msb7p
In[2]:=2

✖
https://wolfram.com/xid/0h2kt4vkeb-o77gvy
Out[2]=2

In[3]:=3

✖
https://wolfram.com/xid/0h2kt4vkeb-e8m8nv
Scope (1)Survey of the scope of standard use cases
Check if the file specified by the File object exists:
In[1]:=1

✖
https://wolfram.com/xid/0h2kt4vkeb-nmjj2
In[2]:=2

✖
https://wolfram.com/xid/0h2kt4vkeb-bzvdwh
Out[2]=2

Wolfram Research (2008), FileExistsQ, Wolfram Language function, https://reference.wolfram.com/language/ref/FileExistsQ.html (updated 2016).
✖
Wolfram Research (2008), FileExistsQ, Wolfram Language function, https://reference.wolfram.com/language/ref/FileExistsQ.html (updated 2016).
Text
Wolfram Research (2008), FileExistsQ, Wolfram Language function, https://reference.wolfram.com/language/ref/FileExistsQ.html (updated 2016).
✖
Wolfram Research (2008), FileExistsQ, Wolfram Language function, https://reference.wolfram.com/language/ref/FileExistsQ.html (updated 2016).
CMS
Wolfram Language. 2008. "FileExistsQ." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2016. https://reference.wolfram.com/language/ref/FileExistsQ.html.
✖
Wolfram Language. 2008. "FileExistsQ." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2016. https://reference.wolfram.com/language/ref/FileExistsQ.html.
APA
Wolfram Language. (2008). FileExistsQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FileExistsQ.html
✖
Wolfram Language. (2008). FileExistsQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FileExistsQ.html
BibTeX
✖
@misc{reference.wolfram_2025_fileexistsq, author="Wolfram Research", title="{FileExistsQ}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/FileExistsQ.html}", note=[Accessed: 25-March-2025
]}
BibLaTeX
✖
@online{reference.wolfram_2025_fileexistsq, organization={Wolfram Research}, title={FileExistsQ}, year={2016}, url={https://reference.wolfram.com/language/ref/FileExistsQ.html}, note=[Accessed: 25-March-2025
]}