Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tArgs = {...}
- num = 0
- while fs.exists("tempFile" .. tostring(num)) do
- num = num + 1
- end
- num = tostring(num)
- shell.run("copy " .. tArgs[2] .. " tempFile".. num)
- tempWrite = fs.open(tArgs[2], "w")
- tempWrite.writeLine("--==ORIGINAL CODE==--")
- for line in io.lines("tempFile" .. num) do
- tempWrite.writeLine(line)
- end
- tempWrite.writeLine("--==APPENDED CODE==--")
- for line in io.lines(tArgs[1]) do
- tempWrite.writeLine(line)
- end
- tempWrite.flush()
- tempWrite.close()
- shell.run("delete tempFile" .. num)
- print(tArgs[1] .. " successfully appended to " .. tArgs[2])
Add Comment
Please, Sign In to add comment