G
goo
Guest
I am trying to read all sub directories from a given directory, and doing that recursive. I am getting a problem with an array that I get back from System.IO.Directory:GetDirectories(ipDirectory). Could I make an instance of String and add it to that instead of using cDirectories as char ... as I do? is there an easier way of doing what I want? I want to add all directories into a temp-table with a parent pointer. //Geir Otto procedure checkDirectory : define input param ipDirectory as char no-undo. define input param ipParentId as int no-undo. def var cDirectories as char extent no-undo. def var ixx as int no-undo. ix = ix + 1. bDirectoryExist = System.IO.Directory:Exists(ipDirectory). if not bDirectoryExist then do: return ?. end. create ttDirectory. assign ttDirectory.iDirectoryId = ix ttDirectory.cDirectoryName = ipDirectory ttDirectory.iParentDirectory = ipParentId . cDirectories = System.IO.Directory:GetDirectories(ipDirectory). do ixx = 1 to extent(cDirectories): run checkDirectory(cDirectories[ixx],ttDirectory.iDirectoryId). end. if ix gt 300 then stop. end.
Continue reading...
Continue reading...