File.modified read/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.

If the file do not exist, this property returnsniland setting its value will have no effect.

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)