|parrotcode: Lua Operating System Library|
|Contents | Language Implementations | Lua|
lib/luaos.pir - Lua Operating System Library
This library is implemented through table
See "Lua 5.1 Reference Manual", section 5.8 "Operating System Facilities".
os.date ([format [, time]])
timeargument is present, this is the time to be formatted (see the
os.timefunction for a description of this value). Otherwise,
dateformats the current time.
!, then the date is formatted in Coordinated Universal Time. After that optional character, if
datereturns a table with the following fields:
wday(weekday, Sunday is 1),
yday(day of the year), and
isdst(daylight saving flag, a boolean).
datereturns the date as a string, formatted according with the same rules as the C function
datereturns a reasonable date and time representation that depends on the host system and on the current locale (that is,
os.date()is equivalent to
os.difftime (t2, t1)
t2. In Posix, Windows, and some other systems, this value is exactly
system. It passes
commandto be executed by an operating system shell. It returns a status code, which is system-dependent.
system. It passes
commandto be executed by an operating system shell. It returns a status code, which is system-dependent. If
commandis absent, then it returns nonzero if a shell is available and zero otherwise.
exit, with an optional
code, to terminate the host program. The default value for
codeis the success code.
varname, or nil if the variable is not defined.
os.rename (oldname, newname)
newname. If this function fails, it returns nil, plus a string describing the error.
os.setlocale (locale [, category])
localeis a string specifying a locale;
categoryis an optional string describing which category to change:
"time"; the default category is
"all". The function returns the name of the new locale, or nil if the request cannot be honored.
day, and may have fields
isdst(for a description of these fields, see the
timecan be used only as an argument to