Implement loading raw members index.
This commit is contained in:
parent
325aca8454
commit
603ffa53bb
1 changed files with 24 additions and 11 deletions
|
@ -21,9 +21,16 @@
|
|||
;; CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
;;
|
||||
(import (chicken condition)
|
||||
(chicken process-context)
|
||||
(chicken file)
|
||||
(chicken file posix))
|
||||
(chicken pathname)
|
||||
(chicken file posix)
|
||||
|
||||
(chicken process-context))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Static default configuration
|
||||
|
||||
(define *members-directory* "members")
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Testing
|
||||
|
@ -101,15 +108,21 @@
|
|||
(print " ok."))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Members index
|
||||
|
||||
(define *members-directory* "members")
|
||||
|
||||
(define (displayln . x)
|
||||
(apply display x)
|
||||
(newline))
|
||||
|
||||
(define (load-members)
|
||||
(directory *members-directory*))
|
||||
(define (load-members-raw-index . dn)
|
||||
(let ((dn (if (null? dn) *members-directory* (car dn))))
|
||||
(let loop ((fns (directory dn))
|
||||
(rs '()))
|
||||
(if (null? fns)
|
||||
rs
|
||||
(let* ((fn (car fns))
|
||||
(ffn (make-pathname dn fn))
|
||||
(sl (if (symbolic-link? ffn) (read-symbolic-link ffn) #f)))
|
||||
(loop (cdr fns)
|
||||
(if sl
|
||||
(cons (cons fn sl) rs)
|
||||
rs)))))))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Run everything
|
||||
|
@ -125,4 +138,4 @@
|
|||
(newline)
|
||||
|
||||
;; Perform requested action
|
||||
(displayln (load-members))
|
||||
(print (load-members-raw-index))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue