- ;返回给定路径下的所有子路径(递归)
- (defun K:GetSubPath (Path / Folder)
- (mapcar
- '(lambda (x)
- (setq Folder (strcat Path "\\" x))
- (cons Folder (apply 'append (K:GetSubPath Folder)))
- )
- (cddr (vl-directory-files Path nil -1))
- )
- )
假设我们给定一个路径:
- (setq CurPath "C:\\XX")
可以这样获取所有路径(包含给定路径本身)
- (setq PathLst (apply 'append (cons (list CurPath) (K:GetSubPath CurPath))))
|