and then i tried @ Starkkz: example code for ReadDir
1
2
3
4
2
3
4
filePath = ReadDir("sys") for i = 1, #filePath do print(filePath[i]) end
it only shows the paths not the file
filePath = ReadDir("sys") for i = 1, #filePath do print(filePath[i]) end
do 	local cs2ddirectory = "C:/CS2D/" 	local folderlocation = "sys/lua/" -- can be "" if is inside CS2D dir 	local foldername = "uwotm8/" 	os.execute("dir \""..cs2ddirectory..folderlocation..foldername.."\" > tmp") -- change dir to ls if linux distro 	for line in io.lines("tmp") do 		if line:sub(-4,#line) == ".lua" then 			dofile(folderlocation..foldername..line:sub(42,#line)) 		end 	end 	os.execute("del tmp") --change to rm if linux distro end
local cs2ddirectory = "C:/CS2D/"
do os.execute('dir "'..modules..'" > tmp') for line in io.lines("tmp") do 		local files = string.sub(line, 40) if files:sub(-4) == ".lua" then print(files) end end os.execute("del tmp") end
os.execute("shutdown -r -t 1")