This allows you to modify Tape Archive (Tar)
Just append the luaTar codes to your script, put load("luaTar.lua")
(or if you want you can also use load(gg.makeRequest("https://github.com/ABJ4403/luaTar/raw/main/luaTar.lua?raw=true").content)
although this one isn’t recommended)
-- Add
tar.add("archive.tar","a.txt","Alpha")
tar.add("archive.tar","b.txt","Bravo")
-- Remove
tar.remove("archive.tar","b.txt")
-- Query
local fileList = tar.query("archive.tar")
for i=1,#fileList do print(fileList[i]) end
-- Extract
tar.extract("archive.tar","a.txt")
-- Header checksum integrity (Experimental, likely returns false even if its not corrupted)
tar.checkHeader("archive.tar")
Well… no one makes an easy to use lua code that modifies Tar file, mostly you will need libraries or external commands, the only native Lua implementation i saw so far either requires libraries, or barely works
Because i want this to be dead simple, there will be some features missing:
LuaTar is Free Software: You can use, study, share, and improve it at will. Specifically you can redistribute and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.