io.read()io.open()io.write()file.open()io.write()io.append()io.input()file.write()io.read() function do in Lua?
io.read("*all")io.read("*line")io.read("*char")io.read("*block")io.close()file.close()io.end()io.finish()io.write()io.print()io.output()file.write()"w"), what happens if the file already exists?
io.read("*line")io.read(1)file.readline()io.read("*char")io.read("*number")io.read("*line")io.read("*all")file.read("*num")io library is used to open a file?
io.open()io.file()io.openfile()file.open()"r""w""a""x""a""r""w""rw""r+""rw""rw+""r"io.open()io.check()io.exists()file.exists()"r" mode but does not exist?
nil and an error messageio.read("*line") in a loopio.readlines()file.read("*lines")io.read(5)io.flush() function in Lua?
"r" mode?
io.write() multiple timesio.println()file.writelines()io.append()"rb""b""rt""w""rb+""rw+""br+""rw""r" and "rb" modes in Lua?
"r" opens a text file, "rb" opens a binary file"r" is used for writing, "rb" for reading"r" opens for reading and writing, "rb" for reading only"w" mode do when opening a file in Lua?
"a" mode when opening a file in Lua?
"r""rb""w""wt""r+""w+""rw""b+""x""r+""w""a""rb" mode do when opening a file in Lua?
"a""w""r""rb"| Qno | Answer (Option with the text) |
|---|---|
| 1 | b) io.open() |
| 2 | a) io.write() |
| 3 | b) It reads a specified number of characters from the file |
| 4 | a) io.read("*all") |
| 5 | a) io.close() |
| 6 | a) io.write() |
| 7 | a) It overwrites the file |
| 8 | a) io.read("*line") |
| 9 | a) io.read("*number") |
| 10 | a) An error is raised |
| 11 | a) io.open() |
| 12 | a) "r" |
| 13 | a) "a" |
| 14 | a) "r+" |
| 15 | a) io.open() |
| 16 | a) It returns nil and an error message |
| 17 | a) Using io.read("*line") in a loop |
| 18 | a) It flushes the output buffer to the file |
| 19 | a) An error is raised |
| 20 | a) Use io.write() multiple times |
| 21 | a) "rb" |
| 22 | a) "rb+" |
| 23 | a) "r" opens a text file, "rb" opens a binary file |
| 24 | a) It opens the file for writing, creating a new file or overwriting an existing one |
| 25 | a) To open a file for appending data at the end of the file |
| 26 | a) "r" |
| 27 | a) "r+" |
| 28 | a) "x" |
| 29 | a) Opens the file for reading in binary mode |
| 30 | a) "a" |