Look at title!
I have been searching for hours please help
0
List all folders but no files from a directory in program
Started by TechnicalCoding, Jun 12 2016 09:26 PM
lua
3 replies to this topic
#1
Posted 12 June 2016 - 09:26 PM
#2
Posted 12 June 2016 - 09:31 PM
use fs.list in conjunction with fs.isDir (isDirectory)
function listFolders(directory) local all = fs.list(directory) local tab = {} for i=1,#all do if fs.isDir( fs.combine(directory, all[i] ) ) then table.insert(tab, all[i]) end end return tab end
Edited by Incinirate, 13 June 2016 - 01:19 AM.
#3
Posted 13 June 2016 - 01:08 AM
You may need to change a line:
if fs.isDir( fs.combine(directory, all[i] ) ) then
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users