From c2128a40cf61cfb341007a79febc2d38752c6757 Mon Sep 17 00:00:00 2001 From: erana Date: Wed, 1 Feb 2012 13:05:49 +0900 Subject: [PATCH] spider load file --- s48/cavespider/client.scm | 8 ++++---- s48/cavespider/load.scm | 4 ++-- s48/cavespider/util.scm | 15 ++++++++------- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/s48/cavespider/client.scm b/s48/cavespider/client.scm index e074125..d834aac 100644 --- a/s48/cavespider/client.scm +++ b/s48/cavespider/client.scm @@ -27,7 +27,7 @@ ;;; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. (load "util.scm") -(load "html.scm") + ;;,open posix posix-files (define server-data @@ -66,7 +66,7 @@ (define (ask-server request filename hostname port) (let* ((dir-filename (do ((i 0 (+ i 1))) - ((make-directory (string-append "./" hostname (number->string i)) (file-mode read write exec)) + ((make-directory (string-append "./" hostname (number->string i))) (string-append "./" hostname (number->string i))) ;; return val )) (out-file-port (open-output-file (string-append dir-filename "/" filename))) @@ -91,5 +91,5 @@ ; (display contents) ; (file-contents->url contents) ; ))) - -(ask-server (string-append "GET / HTTP/1.0" (string #\return #\newline #\return #\newline) "index.html" "www.gnu.org" 80)) +;;test +;;(ask-server (string-append "GET / HTTP/1.0" (string #\return #\newline #\return #\newline) "index.html" "www.gnu.org") 80) diff --git a/s48/cavespider/load.scm b/s48/cavespider/load.scm index 7b2faa4..d1436e3 100644 --- a/s48/cavespider/load.scm +++ b/s48/cavespider/load.scm @@ -37,10 +37,10 @@ (display "give port : ") (define port (number->string (read))) (newline) -(define dir-filename (display (ask-server (string-append "GET / HTTP/1.0" (string #\return #\newline #\return #\newline) "index.html" hostname port)))) +(define dir-filename (ask-server (string-append "GET / HTTP/1.0" (string #\return #\newline #\return #\newline)) "index.html" hostname port)) (display "give string to search for (no spaces): ") -(define keyword (symbol->string (read)) +(define keyword (symbol->string (read))) (newline) (let ((file-contents (file->string (string-append dir-filename "/" "index.html"))));;FIXME dir diff --git a/s48/cavespider/util.scm b/s48/cavespider/util.scm index 1fa3c0d..901dda4 100644 --- a/s48/cavespider/util.scm +++ b/s48/cavespider/util.scm @@ -28,12 +28,13 @@ (load "file-util.scm") (load "search-util.scm") -(display "Do you want to use hash tables (y/n)?") -(let ((c (read-char))) - (if (eq? c #\y) - (load "string-util-alt.scm") - (begin - (load "hash-util.scm") - (load "string-util.scm")))) +;(display "Do you want to use hash tables (y/n)?") +;(let ((c (read-char))) +; (if (eq? c #\y) +; (load "string-util-alt.scm") +; (begin +; (load "hash-util.scm") + (load "string-util.scm") +;))) (load "html-util.scm")