lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On Tue, Feb 21, 2017 at 5:01 PM, Soni L. <> wrote:
And any non-empty Lua module file still takes more size on disk than true.lua.
The point is to have it as a separate file/an external module, in which case my statements are true.

On Windows there is no need for extra space on disk!
Windows already has your "true" module integrated as a standard device:

assert(require("nul:") == true)

It works because under Windows the file referred to as ".\nul:.lua" in ANY directory is actually the standard device "NUL:"
(Windows ignores extensions in 8.3 naming scheme for standard driver names: NUL, LPT1, COM1, etc.)


Another interesting application of Windows standard devices:


The text entered from keyboard in runtime will be interpreted as content of the module.
Just enter some Lua code and terminate it with additional line consisting of single Ctrl-Z character.
CON is "console device" in Windows for accessing keyboard (read) and terminal (write).
Please note that CON is not stdin, CON is always a keyboard, it can't be redirected.