This first edition was written for Lua 5.0. While still largely relevant for later versions, there are some differences.
The third edition targets Lua 5.2 and is available at Amazon and other bookstores.
By buying the book, you also help to support the Lua project.


22 – The Operating System Library

The Operating System library includes functions for file manipulation, for getting the current date and time, and other facilities related to the operating system. It is defined in table os. This library pays a price for Lua portability. Because Lua is written in ANSI C, it uses only the functions that the ANSI standard defines. Many OS facilities, such as directory manipulation and sockets, are not part of this standard and therefore the system library does not provide them. There are other Lua libraries, not included in the main distribution, that provide extended OS access. Examples are the posix library, which offers all functionality of the POSIX.1 standard to Lua; and luasocket, for network support.

For file manipulation, all that this library provides is an os.rename function, that changes the name of a file; and os.remove, that removes (deletes) a file.