Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- toDisk = ...
- stringtoboolean = { ["true"] = true, ["false"] = false }
- local bToDisk = false
- if toDisk then
- bToDisk = stringtoboolean[toDisk]
- end
- -- Function to load all programs to or from the disk
- local function loadAllFromDisk(startPath, destinationPath)
- local files = fs.list(startPath)
- for _, file in ipairs(files) do
- local fullPath = fs.combine(startPath, file)
- local destPath = fs.combine(destinationPath, file)
- if not fs.isDir(fullPath) then
- print("Copy " .. file .. " from " .. fullPath .. " to " .. destPath)
- fs.copy(fullPath, destPath)
- end
- end
- print("All files were copied")
- end
- -- Disk-Pfad
- local startPath = "disk/"
- local destinationPath = "/"
- if bToDisk then
- startPath = "/"
- destinationPath = "disk/"
- end
- -- Überprüfen, ob das Disk-Laufwerk vorhanden ist
- if fs.exists("disk/") then
- loadAllFromDisk(startPath, destinationPath)
- else
- print("Keine Disk gefunden. Bitte lege eine Disk ein.")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement