Artifact 86fb1e244788ed14e8c74655bd52b9080712b2af:
- File multi-glob.scm — part of check-in [e22603e687] at 2019-11-21 03:22:04 on branch v1.65 — Added beginnings of multi-level glob (user: matt, size: 605) [annotate] [blame] [check-ins using]
(define (multi-glob pathspec) (let* ((path-parts (string-split pathspec "/" #t))) (if (null? path-parts) '() (let loop ((parts (cdr path-parts)) (result (let ((p (car path-parts))) (if (string=? p "") '("/") (glob (car path-parts)))))) (if (null? parts) result (let* ((part (car parts)) (rem (cdr parts))) (loop rem (apply append (map (lambda (curr) (let ((new (string-append curr "/" part))) (if (and (directory? curr) (file-read-access? curr)) (glob new) '()))) result)))))))))