Work on directory trees

[Autolink] Menu

 
/* example for working on a directory tree without loading the dll    */
/* REXXUTIL                                                           */

                        /* flush the REXX queue                 v3.20 */
  do while queued() <> 0; parse pull; end;

                        /* put a list of all directories in the queue */
                        /* (use /FIFO to get the directories in the   */
                        /*  right order)                              */
  "@dir /s/f /Ad C:\ 2>NUL | RXQUEUE /FIFO"

  foundDirs.0 = 0
                    /* put the names of all found directories         */
                    /* in a compound variable for further processing  */
  do while queued() <> 0
    curDir = strip( lineIn( "QUEUE:" ) )
    if curDir <> "" & ,
       right( CurDir, 2 ) <> "\."  & ,
       right( CurDir, 3 ) <> "\.." then
    do
      j = foundDirs.0 + 1
      foundDirs.j = curDir
      foundDirs.0 = j
    end /* if curDir <> "" then */
  end /* do while queued <> 0 */


[Back: Check if a directory exists]
[Next: Create a directory(-tree)]