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)
Scope (1)
Check if the file specified by the File object exists:
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).
CMS
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