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

copying whole directories from LMFS to Unix



    Date: Mon, 11 Nov 1991 17:22 EST
    From: qobi@ai.mit.edu (Jeffrey Mark Siskind)

    What is the easiest way to copy an entire directory tree from LMFS to Unix
    in such a way that version numbers are preserved (as .~n~ affixes).
	    Thanks,
	    Jeff
I'd do:

(loop with todo = (list (fs:parse-pathname "lmfs:>top>*.*.*"))
      for this-dir = (pop todo)
      while this-dir
      do (loop for entry in (cdr (fs:directory-list this-dir))
               if (si:get e :directory)
               do (push (send (car e) :pathname-as-directory) todo)
               else do (si:copyf (car e) (format nil "unix-host:/its-top/~{~A/~}~A.~A.~~~D~~"
	               (send (car e) :raw-directory) (send (car e) :raw-name) (send (car e) :raw-type)
                       (send (car e) :version)))))

If you have files that are links, you might want to handle them specially, i.e. instead of
only differentiating on the :DIRECTORY property, also differentiate on the :LINK-TO property.

You don't have to supply any more options for the COPYF call because you are going from LMFS
to Unix; if you were going the other way you'd want to heuristicate either a character or a binary
transfer depending upon file type, containing directory or something.