handle.readAll

From ComputerCraft
Jump to: navigation, search

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

Returns the full text of a file.

ExampleExamplePrint the content of the file "hello.lua"
Print the content of the file "/rom/programs/fun/hello.lua"
Code
local handle = fs.open("/rom/programs/fun/hello.lua","r")
print(handle.readAll())
handle.close()
Output
if term.isColour() then
    term.setTextColour( 2^math.random(0,15) )
end
textutils.slowPrint( "Hello World!" )
term.setTextColour( colours.white )