Search code examples
fileluaiostreamhandle

What is the canon/standard name for file handle/stream/file stream of Lua?


I noticed that the thing that is returned by io.open() is called differently. I wonder what the canon name is.

  • in Lua 5.4 Reference Manual, it's called a "file handle".
  • in "Programming in Lua" 4/e, it's called a "stream".
  • I saw in Lua Users Wiki that is's called "file stream" (maybe not the only name used in that Wiki)

Lua Reference Manual should be official, but the book is written by a creator of the language, so both should be canon, yet they use different names.

What is the canon/standard name for it, if there is one? Can anyone provides information? Thanks in advance.


Solution

  • Lua 5.4.6  Copyright (C) 1994-2023 Lua.org, PUC-Rio
    > io.stdin
    file (0x7fff90c0bd90)
    

    That's why the reference manual talks about file handles. A handle is an opaque pointer to an abstract object. It's the same with tables:

    > {}
    table: 0x7f86056042d0
    

    But you shouldn't need to worry about these details. The terminology in Programming in Lua is probably chosen for an audience with diverse backgrounds, but I don't speak for the author.