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

File.modifiedread/write property



The File.modified property set or get a Datetime value indicating when the file has been last modified. 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.modified = timestamp

-- outputs "true"
print(file.modified.date == timestamp.date)