Subject: Re: [clisp-list] logical-pathname

From: Marco Antoniotti <[email-masked]>
Date: Wed Jan 29 13:59:02 2003

On Wednesday, Jan 29, 2003, at 15:36 America/New_York, Pascal 
Bourguignon wrote:

>
> Marco Antoniotti writes:
>>>
>>> I notice  that there is  no way to  get a logical-pathname but  from 
>>> a
>>> logicial-pathname-namestring. Is that correct?
>>>
>>
>> Just to make another argument about this.
>>
>> Suppose you have
>>
>>     (setf (logical-pathname-translations "FOO")
>>        `(("**;*.*" "/usr/foo/*.*")))
>>
>>     (setf (logical-pathname-translations "GNAO")
>>        `(("**;*.*" "/usr/foo/*.*")))
>>
>> The above is legal CL.  Now you do
>>
>>    (translate-logical-pathname "FOO:qwe;rty.c")
>>     ==> #p"/usr/foo/rty.c"
>>
>>    (translate-logical-pathname "GNAO:qwe;rty.c")
>>     ==> #p"/usr/foo/rty.c"
>>
>>
>> The question now is: what should the hypothetical
>>
>> 	(get-logical-pathname-from-namestring "/usr/foo/rty.c")
>>
>> return?
>>
>> Note that there are ways in CL to build a function that would return
>> all the possible logical pathnames from an arbitrary pathname
>> namestring.  This involves keeping track of all the defined logical
>> hosts and building a match with all possible translations.
>>
>>
>> This is left as an easy exercise to the reader :)
>>
>> Jokes apart, what are you trying to do?
>
> Abstract the unix path name I have in the configuration of my program.
> The current  lisp code I have is  emacs lisp where the  paths are just
> unix path strings.

Ok.

>
>
> In my case,  since I start with "/usr/foo/rty.c" I'll  stick to it, or
> at most to (pathname (fetch-path-string-from-configuration)).
>

Yes.  But this is a particular solution.  Your question asked whether 
it was possible to do the reverse translation in general.

How does this configuration file looks like?

Cheers

--
Marco Antoniotti
NYU Courant Bioinformatics Group		tel. +1 - 212 - 998 3488
715 Broadway 10th FL				fax. +1 - 212 - 998 3484
New York, NY, 10003, U.S.A.