6.9 – Operating System Facilities

This library is implemented through table os.

os.setlocale()
  • References/Lua/Lua/Standard Libraries/Operating System Facilities

os.setlocale (locale [, category]) Sets the current locale of the program. locale is a system-dependent string specifying a locale; category is an optional

2025-01-10 15:47:30
os.tmpname()
  • References/Lua/Lua/Standard Libraries/Operating System Facilities

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

2025-01-10 15:47:30
os.getenv()
  • References/Lua/Lua/Standard Libraries/Operating System Facilities

os.getenv (varname) Returns the value of the process environment variable varname, or nil if the variable is not defined.

2025-01-10 15:47:30
os.exit()
  • References/Lua/Lua/Standard Libraries/Operating System Facilities

os.exit ([code [, close]]) Calls the ISO C function exit to terminate the host program. If code is true, the returned status is EXIT_SUCCESS;

2025-01-10 15:47:30
os.rename()
  • References/Lua/Lua/Standard Libraries/Operating System Facilities

os.rename (oldname, newname) Renames the file or directory named oldname to newname. If this function fails, it returns nil, plus a string describing

2025-01-10 15:47:30
os.time()
  • References/Lua/Lua/Standard Libraries/Operating System Facilities

os.time ([table]) Returns the current time when called without arguments, or a time representing the local date and time specified by the given table. This table must have fields

2025-01-10 15:47:30
os.execute()
  • References/Lua/Lua/Standard Libraries/Operating System Facilities

os.execute ([command]) This function is equivalent to the ISO C function system. It passes command to be executed by an operating system shell. Its first

2025-01-10 15:47:30
os.remove()
  • References/Lua/Lua/Standard Libraries/Operating System Facilities

os.remove (filename) Deletes the file (or empty directory, on POSIX systems) with the given name. If this function fails, it returns nil, plus a string describing the error

2025-01-10 15:47:30
os.clock()
  • References/Lua/Lua/Standard Libraries/Operating System Facilities

os.clock () Returns an approximation of the amount in seconds of CPU time used by the program.

2025-01-10 15:47:30
os.date()
  • References/Lua/Lua/Standard Libraries/Operating System Facilities

os.date ([format [, time]]) Returns a string or a table containing date and time, formatted according to the given string format. If the time

2025-01-10 15:47:30