Tagged 'sub folder'

Get list of all subfolders

1 vote

-- How to get list of all sub folders in special path --

function GetAllSubDirs_fn MyDirectory =
(
temp = #();
s = 1;
folders = getDirectories (MyDirectory + "/*");
t = folders.count;
while s < t do
(
for i = s to t do (temp = getDirectories (folders[i]+"*");
for j = 1 to temp.count do folders[folders.count+1] = temp[j] );
s = t;
t = folders.count;
)
sort folders
return folders;
)
-- call the function whit a folder path --

GetAllSubDirs_fn("D:")