#lang scheme/base (provide get-file-tree get-plt-file-tree) (require "tree.ss" setup/dirs) ;; ---------------------------------------------------------------------------- ;; Reading a tree from a directory (define (get-file-tree path) (define path* (simplify-path path)) (let loop ([path path*] [name (regexp-replace #rx#"/$" (path->bytes path*) #"")]) (cond [(directory-exists? path) (make-tree (bytes-append name #"/") (parameterize ([current-directory path]) (let* ([subs (map (lambda (sub) (cons (path-element->bytes sub) sub)) (directory-list))] [subs (sort subs bytes