Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function printUsage()
- print( "Usages:" )
- print( "cpfiles <input dir> <output dir>" )
- end
- local tArgs = { ... }
- if #tArgs < 2 then
- printUsage()
- return
- end
- indir=tArgs[1]
- if(not(fs.isDir(indir)))then
- print( "Not a directory" )
- return
- end
- outdir=tArgs[2]
- if(not(fs.isDir(outdir)))then
- print( "Not a directory" )
- return
- end
- FileList=fs.list(indir)
- CountFiles=#FileList
- for i=1,CountFiles do
- if(not(fs.exists(outdir.."/"..FileList[i])))then
- if(not(fs.isDir(indir.."/"..FileList[i])))then
- fs.copy(indir.."/"..FileList[i],outdir.."/"..FileList[i])
- if not(fs.exists(outdir.."/"..FileList[i])) then
- print(FileList[i].." was not copied")
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement