lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi everyone,
 
I'm using the next function in Lua to compile a luafile.
 
function CompileLua(file, fileout)
 assert(type(file)=="string" and type(fileout)=="string", "Please parse a string!")
 if(type(fileout)=="nil")then fileout="out.luac";end
 local f=assert(io.open(fileout,"wb"))
 assert(f:write(string.dump(assert(loadfile(file)))))
 assert(f:close())
end
 
However, when an error occurs in that file (after loading it later), it points to the original filename. This, I understand,
but I would like to change this somehow. I have noticed that at byte 17 in the output file, the path to the original file
is stored. Does anyone have some information regarding the fileheader, and on how to change this? What I'm actually
after, is the path always starting at the same byte and is it using MAX_PATH space or is the length of the path defined
elsewhere? And also, would changing it cause any problems with the functionallity of the bytecode?
 
Thank you.
 
Bas Groothedde.