help fixing this code

i am not so good with the new file functions
this code is suppose to look in directory’s give to it and add all the files in it to the resource.addfile list


function AddDir(dir) // recursively adds everything in a directory to be downloaded by client
	local files, list = file.Find("../"..dir.."/*","LUA")
	for _, fdir in pairs(list[1]) do
		if fdir != ".svn" then // don't spam people with useless .svn folders
			AddDir(fdir)
		end
	end
 
	for k,v in pairs(file.Find("../"..dir.."/*","LUA")) do
		resource.AddFile(dir.."/"..v)
	end
end

This was asked before.