J_E_Mc 0 Posted November 25, 2018 Share Posted November 25, 2018 I need to read files without the filesystem library but it is only returning 2048 characters of the file i am trying to read. Quote Link to post Share on other sites
1 Solution payonel 21 Posted November 25, 2018 Solution Share Posted November 25, 2018 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) J_E_Mc 1 Quote Link to post Share on other sites
I need to read files without the filesystem library but it is only returning 2048 characters of the file i am trying to read.
Link to post
Share on other sites