Advertisement
tobast

[CC] file installer

Jul 8th, 2014
306
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.37 KB | None | 0 0
  1. --[[
  2.     Script to copy './root/*' to '/'
  3. --]]
  4.  
  5. FROMDIR='/disk/root'
  6.  
  7. function copyRec(path)
  8.     files = fs.list(FROMDIR..path)
  9.  
  10.     for _,file in pairs(files) do
  11.         filepath = path..'/'..file
  12.         if(fs.isDir(FROMDIR..filepath)) then
  13.             fs.makeDir('/'..filepath)
  14.             copyRec(filepath..'/')
  15.         else
  16.             fs.copy(FROMDIR..filepath, '/'..filepath)
  17.         end
  18.     end
  19. end
  20.  
  21. copyRec('')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement