Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Script to copy './root/*' to '/'
- --]]
- FROMDIR='/disk/root'
- function copyRec(path)
- files = fs.list(FROMDIR..path)
- for _,file in pairs(files) do
- filepath = path..'/'..file
- if(fs.isDir(FROMDIR..filepath)) then
- fs.makeDir('/'..filepath)
- copyRec(filepath..'/')
- else
- fs.copy(FROMDIR..filepath, '/'..filepath)
- end
- end
- end
- copyRec('')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement