Change file naming for cache files, so that it satisfies more
authorChris Hanson <org/chris-hanson/cph>
Sun, 18 Nov 2001 04:53:04 +0000 (04:53 +0000)
committerChris Hanson <org/chris-hanson/cph>
Sun, 18 Nov 2001 04:53:04 +0000 (04:53 +0000)
stringent Windows requirements.  Make sure that directory structure
exists before locking a folder.

v7/src/imail/imail-imap.scm

index 6ef597aa3d8510e30d827098dcbd6f8eb977663f..5dfca30d62dc630d71abc84d40a05f955799c654 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;; $Id: imail-imap.scm,v 1.192 2001/11/06 05:01:50 cph Exp $
+;;; $Id: imail-imap.scm,v 1.193 2001/11/18 04:53:04 cph Exp $
 ;;;
 ;;; Copyright (c) 1999-2001 Massachusetts Institute of Technology
 ;;;
   (let ((if-not-locked (if (default-object? if-not-locked) #f if-not-locked))
        (pathname (imap-folder-lock-pathname folder))
        (locked? #f))
+    (guarantee-init-file-directory pathname)
     (dynamic-wind
      (lambda () unspecific)
      (lambda ()
 (define (message-item-pathname message keyword)
   (init-file-specifier->pathname
    `(,@(imap-message-cache-specifier message)
-     ,(if (symbol? keyword) (symbol-name keyword) keyword))))
+     ,(encode-cache-namestring
+       (if (symbol? keyword)
+          (symbol-name keyword)
+          keyword)))))
 
 (define (imap-message-cache-pathname message)
   (pathname-as-directory
   (let ((url (resource-locator folder)))
     (list "imail-cache"
          (string-append (encode-cache-namestring (imap-url-user-id url))
-                        "@"
+                        "_"
                         (string-downcase (imap-url-host url))
-                        ":"
+                        "_"
                         (number->string (imap-url-port url)))
          (encode-cache-namestring (imap-url-mailbox url)))))
 
                  ((char=? char #\/)
                   (write-char #\. port))
                  (else
-                  (write-char #\= port)
+                  (write-char #\% port)
                   (let ((n (char->integer char)))
                     (if (fix:< n #x10)
                         (write-char #\0 port))