Difference between revisions of "love.filesystem.getLastModified"

(Initial function description with example)
 
Line 1: Line 1:
{{newin|[[0.7.1]]|type=function}}
+
{{newin|[[0.7.1]]|071|type=function}}
 
Gets the last modification time of a file.
 
Gets the last modification time of a file.
 
== Function ==
 
== Function ==

Revision as of 09:39, 25 March 2011

Available since LÖVE 0.7.1
This function is not supported in earlier versions.

Gets the last modification time of a file.

Function

Synopsis

modtime, errormsg = love.filesystem.getLastModified( filename )

Arguments

string filename
The path and name to a file.

Returns

number modtime
The last modification time in seconds since the unix epoch or nil on failure.
string errormsg
The error message on failure.

Examples

Getting the time of a file and printing it as a date.

modtime, errormsg = love.filesystem.getLastModified("file.dat")

if modtime then
	print(os.date("%c", modtime)) -- "02/15/2011 12:32:11" (Depends on the system and locale)
end

See Also

Other Languages