From bafb87990da3b92e91ceb18f4535c1e96c2d6e83 Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Thu, 18 Sep 2008 19:42:30 +0000 Subject: [PATCH] create directories that are specified but missing, use open-output-nowhere svn: r11810 --- collects/handin-server/private/config.ss | 7 ++++--- collects/handin-server/private/logger.ss | 6 +----- collects/handin-server/scribblings/server-setup.scrbl | 3 ++- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/collects/handin-server/private/config.ss b/collects/handin-server/private/config.ss index de64f1f290..892c348c4e 100644 --- a/collects/handin-server/private/config.ss +++ b/collects/handin-server/private/config.ss @@ -100,10 +100,11 @@ (define (paths->map dirs) (define (path->name dir) (unless (directory-exists? dir) - (error 'get-conf - "directory entry for an inexistent directory: ~e" dir)) + (if (file-exists? dir) + (error 'get-conf "directory entry points at a file: ~e" dir) + (make-directory* dir))) (let-values ([(_1 name _2) (split-path dir)]) - (bytes->string/locale (path-element->bytes name)))) + (path-element->string name))) (let ([names (map path->name dirs)]) (append (map list names dirs) (map list dirs names)))) diff --git a/collects/handin-server/private/logger.ss b/collects/handin-server/private/logger.ss index 3f6176fe38..fc5a42e054 100644 --- a/collects/handin-server/private/logger.ss +++ b/collects/handin-server/private/logger.ss @@ -35,11 +35,7 @@ ;; output the line on the output port (define (make-logger-port out log) (if (and (not out) (not log)) - ;; /dev/null-like output port - (make-output-port 'nowhere - always-evt - (lambda (buf start end imm? break?) (- end start)) - void) + (open-output-nowhere) (let ([prompt? #t] [sema (make-semaphore 1)] [outp (cond [(not log) out] diff --git a/collects/handin-server/scribblings/server-setup.scrbl b/collects/handin-server/scribblings/server-setup.scrbl index 8772dec288..2ca94ad738 100644 --- a/collects/handin-server/scribblings/server-setup.scrbl +++ b/collects/handin-server/scribblings/server-setup.scrbl @@ -32,7 +32,8 @@ This directory contains the following files and sub-directories: absolute; the last path element for each of these (and @scheme[inactive-dirs] below) should be unique, and is used to identify the submission (for example, in the client's submission - dialog and in the status servlet).} + dialog and in the status servlet). If a specified directory does + not exist, it will be created.} @item{@indexed-scheme[inactive-dirs] --- a list of inactive submission directories (see above for details).}