1

In moonscript, what does the *all when reading a file mean ?

Sample script:

file = io.open('README.md', "rb")
content = file\read("*all")

If there is a *all are there other pointers that reads half the file etc?

Muhammad Lukman Low
  • 8,177
  • 11
  • 44
  • 54

1 Answers1

3

It means what it says: read the whole file (actually, what is left of it).

No, there is no direct way to read half the file.

You can read a given number of bytes.

lhf
  • 70,581
  • 9
  • 108
  • 149
  • this is not a moonscript specific thing by the way, you can read about it in the Lua docs: https://www.lua.org/pil/21.1.html – s-ol Apr 21 '17 at 13:29