lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


-- This code works for me:
local dircmd = "find . -type f -print" -- default to Unix
if string.sub(package.config,1,1) == '\\' then
	-- Windows
	dircmd = "dir /b/s"
end

os.execute(dircmd .. " > zzfiles")

local luafiles = {}
for f in io.lines("zzfiles") do
	if f:sub(-4) == ".lua" then
		luafiles[#luafiles+1] = f
	end
end

print(table.concat(luafiles, "\n"))