LolzPB

mv

May 21st, 2020
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. args = {...}
  2.  
  3.  
  4. if #args < 2 then
  5. print("Uso: mv <file> <nome>")
  6. return
  7. end
  8.  
  9. cdir = shell.resolve(args[1])
  10. ncdir = shell.resolve(args[2])
  11.  
  12. file = fs.open(cdir, "r")
  13. cont = file.readAll()
  14. file.close()
  15. file = fs.open(ncdir, "w")
  16. file.write(cont)
  17. file.close()
  18. fs.delete(cdir)
Advertisement
Add Comment
Please, Sign In to add comment