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

File.accessedread/write property



The File.accessed property set or get a Datetime value indicating when the file has been last accessed. The file must exist physically on the disk.

Example


local file = sys.File("newfile.txt"):open("write")
file:write("This is a test file")
file:close()

local timestamp = sys.Datetime("01/01/1970")
file.accessed = timestamp

-- outputs "true"
print(file.accessed == timestamp)