This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- this function reads the RPP and stores it as chunks of 8 Kb in a table. This is more efficient than reading the file line by line (or at least I believe it is, please someone prove me wrong if you disagree =]) | |
function readProjFileToTable(projFile) | |
local f = assert(io.open(projFile,"r")) | |
local projectChunks = {} | |
local BUFSIZE = 2^13 -- 8K | |
while true do | |
local projectChunk, rest = f:read(BUFSIZE, "*line") | |
if not projectChunk then break end | |
if rest then projectChunk = projectChunk .. rest .. '\n' end | |
table.insert(projectChunks,projectChunk) |