getting directories
BlitzMax Forums/BlitzMax Beginners Area/getting directories
| ||
Hi all, I know this is prob. pretty easy but how do i get a list of sub directories within a directory? i.e i have a directoy sctructure like so: ~/users ~/users/gavin ~/users/mark ~/users/dave i want to scan thru the ~/users dir and create get the names of all the sub dirs to store in an array? thanks alot |
| ||
check out ReadDir LoadDir ChangeDir NextFile Shows up under the File System node in the help. |
| ||
thx :) |
| ||
strict Local dir:String[] dir = LoadDir( CurrentDir() ) For Local i:Int = 0 Until Len(dir) If FileType( dir[i] ) = 2 Then ' dir[i] is a directory Print dir[i] ElseIf FileType( dir[i] ) = 1 Then ' dir[i] is a file EndIf Next |
| ||
thx, that works a treat |