ierate through folders & subfolders (again)


    Jan 19 2007 | 8:03 am
    Hello,
    i can't get a hand on the workaround i made before to output all the files contained in a path, including those in subfolders & subfolders of subfolders. This is a school example we could prototype on a piece of paper, i guess, but i've decided i am only a musician this month, so the logic of this code keep avoiding me (or the reverse).
    I don't need the job's done, not at all, but i would appreciate to hear about the structure of the loop (or the loops) needed to achieve this in a clean, short & beautiful piece of code... After that, i could be easily ported to Java, C, whatever.
    nb: yes i know folderiter.js example very well, yes jhno wrote a folderiter external but i don't have the sources.
    best regards
    f.e -- f.e chanfrault | aka | personal computer music > >>>>>> http://www.personal-computer-music.com > >>>>>> |sublime music for a desperate people|

    • Jan 19 2007 | 8:54 am
      Hi f.e.,
      On 19 janv. 07, at 09:03, f.e wrote:
      > Hello, > > i can't get a hand on the workaround i made before to output all the > files contained in a path, including those in subfolders & subfolders > of subfolders.
      > nb: yes i know folderiter.js example very well
      Everything is in folderiter.js' recursefolders function, so what's your problem?
      There is one single loop, used to treat sequencially all the items in the current folder. If the current item is a folder, then the function is _recursively_ called with the folder's path as argument. So the top->bottom iteration is done thru the recursion, the horizontal one (in one folder) is done thru the loop.
      Hope it helps.
      p
    • Jan 19 2007 | 11:45 am
      Hello Patrick,
      hope you're well. You are absolutely right. After a second check and a few tweaks, the recursefolder function is ok. I don't know why but if failed a lot before, probably because of an erroneous syntax of mine.
      Thanks a lot & cheers
      f.e
      f.e chanfrault | aka | personal computer music > >>>>>> http://www.personal-computer-music.com > >>>>>> |sublime music for a desperate people|
      Patrick Delges wrote: > Hi f.e., > > On 19 janv. 07, at 09:03, f.e wrote: > >> Hello, >> >> i can't get a hand on the workaround i made before to output all the >> files contained in a path, including those in subfolders & subfolders >> of subfolders. > > > >> nb: yes i know folderiter.js example very well > > Everything is in folderiter.js' recursefolders function, so what's > your problem? > > There is one single loop, used to treat sequencially all the items in > the current folder. If the current item is a folder, then the function > is _recursively_ called with the folder's path as argument. So the > top->bottom iteration is done thru the recursion, the horizontal one > (in one folder) is done thru the loop. > > Hope it helps. > > p > >