(define (serve-directory-script selector arguments config)
(let ((filename (make-pathname (config-root-dir config) selector)))
(if (legal-script-filename? filename config)
- (let ((sexp (with-input-from-file filename read)))
- (serve-records (with-selector-dir selector config
- (lambda ()
- (apply (eval sexp) arguments)))
- selector config)
+ (let* ((sexp (with-input-from-file filename read))
+ (selector-dir (pathname-directory selector)))
+ (serve-records (with-selector-dir
+ selector config
+ (lambda ()
+ (apply (eval sexp) arguments)))
+ selector-dir config)
(print ".\r"))
(error "No legal index script not found." filename))))
(config-port-set! config (string->number (caddr args))))
(run-server config)))))))
-(main)
+;; (main)
-;; (define (test)
-;; (run-server (make-config "gopher-root" "localhost" 70 #t)))
+(define (test)
+ (run-server (make-config "gopher-root" "localhost" 70 #t)))
-;; (test)
+(test)