Forse intendi Dos_DirTree...
Credits: Tony Tanzillo?
; 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]