local fs = component.proxy(component.list("filesystem")())
local handle = fs.open("init.lua")
local buffer = {}
repeat
local data = fs.read(handle, math.huge)
table.insert(buffer, data)
until not data
fs.close(handle)
local entire_contents_of_file = table.concat(buffer)
stream handles naturally don't returns ALL of what you ask for, it can take multiple reads. read returns nil when the stream has ended (e.g. eof)