[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Pathname :absolute -> :relative
- To: lynch@aristotle.ils.nwu.edu
- Subject: Re: Pathname :absolute -> :relative
- From: moon (David A. Moon)
- Date: Wed, 20 May 92 16:33:05 EDT
- Cc: info-macl@cambridge.apple.com, bug-mcl
> 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.