package lua
Available on luaOperating System Facilities.
static clock ():Float
Returns an approximation of the amount in seconds of CPU time used by the program.
static date ():DateType
static date (format:String, time:Time):DateType
static date (format:String):DateType
static difftime (t2:Time, t1:Time):Float
Returns the number of seconds from time t1
to time t2
. In POSIX, Windows, and some other systems, this value is exactly t2-t1
.
static execute (?command:String):Dynamic
This function is equivalent to the C function system. It passes command to be executed by an operating system shell. It returns a status code, which is system-dependent. If command is absent, then it returns nonzero if a shell is available and zero otherwise.
static exit (code:Int):Int
Calls the C function exit, with an optional code, to terminate the host program. The default value for code is the success code.
static getenv (varname:String):String
Returns the value of the process environment variable varname
, or null
if the variable is not defined.
static remove (filename:String):OsSuccess
Deletes the file or directory with the given name. Directories must be empty to be removed.
static rename (oldname:String, newname:String):OsSuccess
Renames file or directory named oldname
to newname
.
static setlocale (locale:String, ?category:LocaleCategory):String
Sets the current locale of the program.
static time (?arg:TimeParam):Time
Returns the current time when called without arguments, or a time representing the date and time specified by the given table.
The returned value is a number, whose meaning depends on your system. In POSIX, Windows, and some other systems, this number counts the number of seconds since some given start time (the "epoch"). In other systems, the meaning is not specified, and the number returned by time can be used only as an argument to date and difftime.
static tmpname ():String
Returns a string with a file name that can be used for a temporary file. The file must be explicitly opened before its use and explicitly removed when no longer needed.
When possible, you may prefer to use Io.tmpfile
, which automatically removes the file when the program ends.
© 2005–2018 Haxe Foundation
Licensed under a MIT license.
https://api.haxe.org/lua/Os.html