89
Returns the value of the process environment variable varname, or nil if the variable is not
defined.
os.remove (filename)
Deletes the file or directory with the given name. Directories must be empty to be removed. If
this function fails, it returns nil, plus a string describing the error.
os.rename (oldname, newname)
Renames file or directory named oldname to newname. If this function fails, it returns nil, plus a
string describing the error.
os.time ([table])
Returns the current time when called without arguments, or a time representing the date and
time specified by the given table. This table must have fields year, month, and day, and may
have fields hour, min, sec,and isdst (for a description of these fields, see the os.date function).
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.
os.tmpname ()
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. On some
systems (POSIX), this function also creates a file with that name, to avoid security risks.
(Someone
else might create the file with wrong permissions in the time between getting the name and
creating the file.) You still have to open the file to use it and to remove it (even if you do not
use it).
When possible, you may prefer to use io.tmpfile, which automatically removes the file when
the program
ends.