Using the wiki, I couldn't figure out how to differentiate a file from a folder, but searching around the forums I think I found a way. Is there another place I can look for examples of love.filesystem.getInfo? These are the examples that I clipped:
Code: Select all
love.filesystem.getInfo(file, 'file')
love.filesystem.getInfo(file, 'directory')
Code: Select all
function recursiveEnumerate(folder, fileTree)
local filesTable = love.filesystem.getDirectoryItems(folder)
for i,v in ipairs(filesTable) do
local file = folder..'.'..v
if love.filesystem.getInfo(file, 'file') then
table.insert(fileTree, file)
elseif love.filesystem.getInfo(file, 'directory') then
recursiveEnumerate(file, fileTree)
end
end
end