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

Re: Pathname :absolute -> :relative

> Date: Tue, 19 May 1992 15:20:06 -0600
> From: lynch@aristotle.ils.nwu.edu
> Is there a function which will return relative pathnames for an absolute
> one?
> After the user chooses a file (from choose-file-dialog), I'd really like to
> munge the result so that it is relative to ccl: because I know the whole
> system is going to be transported to another computer but the file
> structure from ccl: down will remain the same.
> I'm gonna hack it for now by string parsing, but is there a clean way to do
> this?

Check this out:

(truename (first (directory "ccl:library;ff.*")))
(translate-pathname * (translate-logical-pathname "CCL:*;") "CCL:*;")

bug-mcl: this ought to work with **; instead of *; in the second and
third arguments, but it returns a bogus answer in that case.  In the
absence of that working the user will need to figure out the right
number of wild directory levels to put in by hand.