Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function copyRecursive(src, dest)
- if fs.isDir(src) then
- if not fs.exists(dest) then
- fs.makeDir(dest)
- end
- for _, item in ipairs(fs.list(src)) do
- copyRecursive(fs.combine(src, item), fs.combine(dest, item))
- end
- else
- fs.copy(src, dest)
- end
- end
- local source = "/disk"
- local destination = "/disk2"
- if not fs.exists(source) then
- print("Source disk not found.")
- return
- end
- if not fs.exists(destination) then
- fs.makeDir(destination)
- end
- copyRecursive(source, destination)
- print("Copy complete!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement