Skip to content

exists

io.exists(filename)

Checks if file or directory exists. If you need to know specifically if a file or directory exists, use io.dirExists() or io.fileExists() instead.

ParameterTypeRequiredDefaultDescription
filenamestringYes-The path to the file or directory to check.
TypeDescription
booleantrue if the file or directory exists, false otherwise.
if io.exists("./file.txt") then
ac.log("Exists!")
end