handle.readAll

handle.readAll
Function
Syntax
handle.readAll()
Returns string Text
API fs
Source CC:Tweaked

Returns the full text of a file.

ExamplePrint the content of the file "hello.lua"
Print the content of the file "/rom/programs/fun/hello.lua"
Code
<nowiki>
local handle = fs.open("/rom/programs/fun/hello.lua","r")
print(handle.readAll())
handle.close()
  </nowiki>
Output
if term.isColour() then
    term.setTextColour( 2^math.random(0,15) )
end
textutils.slowPrint( "Hello World!" )
term.setTextColour( colours.white )
This article is issued from Computercraft. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.