maybe not the best way but so far thats only one i could find which works
usage:
local f = RageFileUtil.CreateRageFile();
if f:Open("test.txt", 2) then -- 2 means write, 1 - read (from RageFile.h) maybe those need some lua enum?
f:PutLine("test text line");
f:Close();
end;
f:destroy();