Luart
Comprehensive Windows framework to develop in Lua
modules > sys > File > exists

File.existsreadonly property



The File.exists property returns a boolean value indicating if the File exists physically on the drive or not.

Example


local file = sys.File("hello.txt")

if not file.exists then
	-- file does not exists, so we will create it
	file:open("write")
	file:write("Hello World !")
	file:close()
end
file:open()
print(file:read())