[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CD-ROM on Sun as SYS host



> Date: Fri, 21 May 93 15:07:22 PDT
> From: uunet!Teknowledge.COM!tbarnes@ascent.UUCP (Terry A Barnes)
> To: slug@ai.sri.com
> Cc: tbarnes@Teknowledge.COM
> Subject: CD-ROM on Sun as SYS host
> 
> Has anyone set up a CD-ROM on a Sun as their SYS host?  The Genera 8.3
> documentation suggests that this is possible, but the instructions are
> incorrect and/or incomplete on how to do it.

Actually, I think the instructions say that it isn't possible, but
that's wrong (mostly)

> 
> The problem is that dash characters have been replaced by underscores in the
> CD-ROM filenames.  I had assumed that this would be fairly easy to correct
> using the logical pathname mechanisms.  But pathname translations are clearly
> inadequate, since a filename may have an arbitrary number of underscores.  None
> of the predefined translation rules seem appropriate (:vms-heuristicate allows
> character substitution, but also does other nasty things).  It would appear
> that I need to code a new translation rule to do the job...
> 
> 1) Am I missing some easier fix?
> 2) If not, has someone already written such a translation rule?
> 
> 			Thanks!
> 			Terry Barnes

Yes, I wrote such a thing a long time ago.  It works pretty well,
_except_ for systems with patches (at least in Genera 8.1, which I am
running).  The problem with patches is that the system utility has
HARD WIRED pathnames for the "PATCH-DIRECTORY;" or some such logical
pathname component, bypassing the pathname translation stuff.  There
are also problems using the Documentation System from CD, but it works
most of the time. Here is my sys:site;sys.translations file.  Remember
this is 8.1 and I wrote it a long time ago.  Looking at the code, it
reminds me that you will need to have your fonts in a real directory,
but I don't remember why.  See the last two entries in the
:translations for the interesting bits, plus the :site-rules entry.



;;; -*- Mode: Lisp; Syntax: Common-Lisp; Package: FILE-SYSTEM -*-

;;; Following two methods hacked in so that the :vms-heuristicate hack
;;; will work.  This is necessary because the CD-ROM sys directory pathnames
;;; have #\- replaced with #\_.  Symbolics says this makes it impossible to 
;;; use a CD-ROM as a SYS host when connected to a Sun, but these hacks make
;;; it work pretty well.

(defmethod (:filename-length unix42-pathname-mixin) () 1024)

(defmethod (:filename-charset unix42-pathname-mixin) () 
  "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890_+.%@#~")

(defun (:sun-cdrom-heuristicate translation-function) (ignore pathname from to
							    &optional substitute)
  (rule-new-pathname (pathname from to :substitute substitute :do-directory t :do-name t)
    (setq type
	  (heuristicate-name-component
		type (send to :filename-length)
		(send to :send-if-handles :filename-charset)
		substitute))
    (values host device directory name type version)))


(multiple-value-bind (major minor) (sct:get-release-version)
  (fs:set-logical-pathname-host "SYS"
    :physical-host (send (parse-pathname (send net:*local-site* :site-directory))
			 :host)
    :translations
    `(("site;" ,(send net:*local-site* :site-directory))
      ("8-1-patches;**;" ">8-1-patches>**>")
      ("alps;**;" ">alps>rel-8-1-1>**>")
      ("fonts;tv;" ">sys>fonts>tv>")
      ("**;*.*.*" "fv:/cdrom/sys/**/*.*"))
    :site-rules
    '((:unix42 ("sys:**;*.*.*" :sun-cdrom-heuristicate ((#\- #\_)))))))