Loading ...
Sorry, an error occurred while loading the content.
 

Re: Using GetFiles to find folders

Expand Messages
  • flo.gehrke
    ... There is no D parameter to be used with ^$GetFiles$. I would propose to try two solutions: (1) Using ^$GetFiles$ (needs NT 7.0) ^!Set
    Message 1 of 2 , Dec 8, 2012
      --- In ntb-clips@yahoogroups.com, "warner_hughes" <whug@...> wrote:
      >
      > I have tried every combination I can think of to use ^$GetFiles()$
      > to make a list of folders, using the attr "D", per the Help file.

      There is no 'D' parameter to be used with ^$GetFiles$.

      I would propose to try two solutions:

      (1) Using ^$GetFiles$ (needs NT 7.0)

      ^!Set %Dirs%=^$GetFiles("+[Path]";nul)$
      ^!Set %Dirs%=^$StrReplace(""^%Space%"";";";"^%Dirs%";A)$
      ^!Set %Dirs%=^$StrReplace("nul";"";"^%Dirs%";A)$
      ;^!Set %Dirs%=^$StrSort("^%Dirs%";0;1;0)$
      ^!SetArray %projects%=^%Dirs%

      (2) Using ^$GetDosOutput$

      ^!SetArray %projects%=^$GetDosOutput(dir [Path]\*.* /A:D /B)$

      This certainly needs some fine-tuning -- but I hope it could serve as a first approach...

      Regards,
      Flo

      P.S. #1 is based on some ideas in Jody's (R.I.P) DirStuff.CLB
    Your message has been successfully submitted and would be delivered to recipients shortly.