Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local InputFiles = nil
- local OutputFile = nil
- local OutputFileData = nil
- local InputFile = nil
- local InputFileData = nil
- local Info = "Input"
- term.clear()
- term.setCursorPos(1, 1)
- print("Glue. Version 1.")
- write("Please enter output filename: ")
- OutputFile = read()
- while true do
- term.clear()
- term.setCursorPos(1, 1)
- print(Info)
- write("Please enter input filename or foldername: ")
- InputFile = read()
- if (fs.isDir(InputFile)) then InputFiles = fs.find(InputFile .. "/*") else InputFiles[1] = InputFile end
- if (InputFile == "stop") then break end
- for i = 1, #InputFiles, 1 do
- InputFile = InputFiles[i]
- if (fs.exists(InputFile)) then
- outfile = fs.open(OutputFile, "a")
- infile = fs.open(InputFile, "r")
- InputFileData = infile.readAll()
- outfile.writeLine("")
- outfile.writeLine("<GluePath>" .. InputFile)
- outfile.write(InputFileData)
- outfile.close()
- infile.close()
- Info = Info .. " : " .. InputFile
- else print("File not found.") sleep(1) end
- end
- end
- term.clear()
- term.setCursorPos(1, 1)
- print("Files glued!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement