[Openmcl-devel] A platform independent pathname without truename

Gary Byers gb at clozure.com
Fri Jul 29 15:23:19 PDT 2011


LOGICAL-PATHNAMEs are CL's way of trying to treat pathnames in a
platform-independent way.  That's a fairly ambitious goal, and it
was even more ambitious 20-25 years ago (when CL was being designed
and when people regularly used a wider variety of filesystems than
they do to today, where it's basically "(modern) Windows, UNIX variants,
and very little else")

It's probably true that there are enough differences between
implementations and filesystems that LOGICAL-PATHNAMEs don't fully
achieve that goal: people who write large systems that run on several
CL platforms still have to conditionalize some code, but they might be
able to keep that conditionalization localized and it'd probably be a
lot harder to maintain those systems if LOGICAL-PATHNAMEs didn't exist.

Being able to say:

? (ensure-directories-exist "ccl:newdir;")

and letting the system deal with the physical pathnames is probably a
lot simpler than the alternatives.

[I'm not 100% sure that this is what you were asking, either.]

On Fri, 29 Jul 2011, Michael Minerva wrote:

> I have been trying to find a good way to return a platform independent pathname without using truename which works for cases where you are creating a path for a file that already exists, but would not work if you are trying to create a path to a file you are about to create.  For example if I call (truename "ccl:") on the mac I get: #P"/Users/Mike/ccl-1.7-dev-r14869/"
> and on the pc I get:
> #P"C:/Users/Mike/Desktop/ccl-windows-mar-30/"
>
> This is all well and good but I cannot use truename if I am trying to create a path for a directory I am trying to create inside the ccl directory (because truename will return an error if the file does not exists).  Is there anyway to get a platform independent path without using truename?
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> http://clozure.com/mailman/listinfo/openmcl-devel
>
>



More information about the Openmcl-devel mailing list