Author Topic: DOS TREE command  (Read 282 times)

0 Members and 1 Guest are viewing this topic.

domenicomaria

  • Bull Frog
  • Posts: 434
DOS TREE command
« on: January 15, 2023, 01:41:15 PM »
Is there any lisp routine that emulates the DOS TREE command ?

And that it also inserts TABs for each nested level ?

ribarm

  • Gator
  • Posts: 2876
  • Marko Ribar, architect
Re: DOS TREE command
« Reply #1 on: January 15, 2023, 01:59:49 PM »
Have you tried from DOS (CMD prompt) :
TREE > tree.txt
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

domenicomaria

  • Bull Frog
  • Posts: 434
Re: DOS TREE command
« Reply #2 on: January 15, 2023, 02:43:07 PM »
Yes
But i need to do it with Lisp

kdub

  • Mesozoic keyThumper
  • SuperMod
  • Water Moccasin
  • Posts: 1602
  • class keyThumper<T>:ILazy<T>
Re: DOS TREE command
« Reply #3 on: January 15, 2023, 03:34:26 PM »


Perhaps have a look at the 'SHELL' command from lisp
Something like :

(command-s "shell" "TREE > tree.txt ")

untested:
Called Kerry in my other life
Retired; but they dragged me back in !

I live at UTC + 13.00

some people complain about loading the dishwasher

Sometimes the question is more important than the answer.

domenicomaria

  • Bull Frog
  • Posts: 434
Re: DOS TREE command
« Reply #4 on: January 16, 2023, 12:40:13 AM »
@kdub
it seems it doesn't work

but still I want to try to do it with Vlisp only

it shouldn't be difficult

however suggestions are welcome

thank you

Marc'Antonio Alessi

  • Swamp Rat
  • Posts: 1366
  • Marco
Re: DOS TREE command
« Reply #5 on: January 16, 2023, 06:28:46 AM »

Forse intendi Dos_DirTree...


Credits: Tony Tanzillo?
Code: [Select]
; Function: ALE_UtlFilesGetFolders
;
; Version 1.00 - 09/06/2006
;
; Description:
;   Returns a list of subdirectories found in the specified directory,
;   the return values contain trailing double-backslashes (\\)
;   if RecFlg = T > scan the entire structure
;
; Arguments:
;   In_Pat = A string containing an existing path
;            do not need trailing double-backslashes
;            if nil or "" uses the current directory.


;   RecFlg = flag > T   = scan the entire structure
;                 > nil = do not scan
;
; Examples:
;   (ALE_UtlFilesGetFolders "C:\\Temp" nil)
;   (ALE_UtlFilesGetFolders "C:\\Temp\\" T)
;
; Return Values:
;   [LIST] A list of subdirectories if successful.
;
(defun ALE_UtlFilesGetFolders (In_Pat RecFlg / FilNam OutLst)
  (or
    (wcmatch In_Pat "*[\\/]")
    (setq In_Pat (strcat In_Pat "\\"))
  )
  (if RecFlg
    (ALE_UtlFilesGetFolders_Aux In_Pat)
    (foreach ForElm (cddr (vl-directory-files In_Pat nil -1))
      (setq OutLst (cons (strcat In_Pat ForElm "\\") OutLst))
    )
  )
  (reverse OutLst)
)
;
; Function: ALE_UtlFilesGetFolders_Aux
; Auxiliary function for: ALE_UtlFilesGetFolders
;
(defun ALE_UtlFilesGetFolders_Aux (In_Pat)
  (foreach ForElm (cddr (vl-directory-files In_Pat nil -1))
    (setq
      FilNam (strcat In_Pat ForElm "\\")
      OutLst (cons FilNam OutLst)
    )
    (ALE_UtlFilesGetFolders_Aux FilNam)
  )
)/[code][/size]

domenicomaria

  • Bull Frog
  • Posts: 434
Re: DOS TREE command
« Reply #6 on: January 16, 2023, 08:43:40 AM »
@marco
Marco grazie ...

questa sera gli do un occhiata
(I'll take a look at it tonight)

ciao