Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to keep case in UNIX pathnames

12 views
Skip to first unread message

Aleksandr Skobelev

unread,
May 27, 2002, 4:26:19 AM5/27/02
to
I have a file with a full pathname
"/home/sasha/lisp/portableaserve/INSTALL.lisp".
When I try to work with this file using logical-pathnames under CMUCL then
capital letters in the filename are transformed into lower-case ones.
For example:

* (translate-logical-pathname "home:lisp;portableaserve;INSTALL.lisp")
#p"/home/sasha/lisp/portableaserve/install.lisp"
*

Is there any way to control a case conversion in this situation?
Or, may be, what is a proper way to use logical-pathnames with mixed-case
filenames under UNIX?

--

Erik Naggum

unread,
May 27, 2002, 10:11:15 AM5/27/02
to
* Aleksandr Skobelev <holy...@mail.ru>

| Or, may be, what is a proper way to use logical-pathnames with mixed-case
| filenames under UNIX?

You need to understand that the point with logical pathnames is to have a
file-system--independent file naming convention that makes porting your
application to a different system not require any internal changes. This
is a fantastically useful thing. If Unix had had logical pathnames, Unix
administration, setup, package installation, etc, would have been simple
and straightforward. Instead, we have tons of different directories that
need to be kept in sync, and packages have compiled-in pathnames. After
I grokked logical pathnames, I have emulated or implemented them wherever
I have gone. Global file systems are simply not good at what they
attempt to do, and hardwiring directories into programs is simply wrong.

The mapping from logical to physical pathnames is strictly one-way. The
idea is to work within a known and safe universe of names and directories
that are always portably mappable to physical pathnames. As long as you
live within that universe, you have solved a number of problems that are
hard even to understand are solvable without such a (standard) mechanism.

So you construct the logical file system with a small number of logical
hosts and name all your files within it/them, and then arrange for the
physical world to have the physical files and directories to which they
are mapped. Going the other way around is simply misguided.
--
In a fight against something, the fight has value, victory has none.
In a fight for something, the fight is a loss, victory merely relief.

70 percent of American adults do not understand the scientific process.

Stefan Schmiedl

unread,
May 27, 2002, 11:40:30 AM5/27/02
to
On Mon, 27 May 2002 14:11:15 GMT,
Erik Naggum <er...@naggum.net> wrote:
> * Aleksandr Skobelev <holy...@mail.ru>
>| Or, may be, what is a proper way to use logical-pathnames with mixed-case
>| filenames under UNIX?
>
> So you construct the logical file system with a small number of logical
> hosts and name all your files within it/them, and then arrange for the
> physical world to have the physical files and directories to which they
> are mapped. Going the other way around is simply misguided.

Does this mean that I have to rename files on Unix systems to
make them accessible to logical pathnames? Right now I am working
on a small program for "overlaying" PDF files, and it would be
highly appreciated by the customer, if the generated file can
be found under the same name, case included.

Does anyone have data on how CL implementations on Windows behave
when they are accessing Unix files stored on a Samba server?

thanks,
s.

Aleksandr Skobelev

unread,
May 27, 2002, 11:45:29 AM5/27/02
to
Thank you.

So, logical pathnames is a leverage for mapping pathnames for files that
are, in some sense, the part of a program, but it is not a leverage for
mapping to/from any phisical pathname into an internal representation.
Don't I misunderstand you?

Joe Marshall

unread,
May 27, 2002, 12:23:48 PM5/27/02
to

"Stefan Schmiedl" <s...@xss.de> wrote in message news:actk1e$sjtd0$1...@ID-57631.news.dfncis.de...

> On Mon, 27 May 2002 14:11:15 GMT,
> Erik Naggum <er...@naggum.net> wrote:
> > * Aleksandr Skobelev <holy...@mail.ru>
> >| Or, may be, what is a proper way to use logical-pathnames with mixed-case
> >| filenames under UNIX?
> >
> > So you construct the logical file system with a small number of logical
> > hosts and name all your files within it/them, and then arrange for the
> > physical world to have the physical files and directories to which they
> > are mapped. Going the other way around is simply misguided.
>
> Does this mean that I have to rename files on Unix systems to
> make them accessible to logical pathnames? Right now I am working
> on a small program for "overlaying" PDF files, and it would be
> highly appreciated by the customer if the generated file can

> be found under the same name, case included.

If you are using logical pathnames, then yes, you may have to rename
files. Logical pathnames were not built to handle every pathname.

>
> Does anyone have data on how CL implementations on Windows behave
> when they are accessing Unix files stored on a Samba server?

A CL implementation would behave the same way any other Windows
program would behave.

Erik Naggum

unread,
May 27, 2002, 4:53:52 PM5/27/02
to
* Stefan Schmiedl

| Does this mean that I have to rename files on Unix systems to make them
| accessible to logical pathnames? Right now I am working on a small
| program for "overlaying" PDF files, and it would be highly appreciated by
| the customer, if the generated file can be found under the same name,
| case included.

Why are you using logical pathnames when you get input pathnames from the
user? What part of "one-way mapping" did you not understand? *sigh*

Erik Naggum

unread,
May 27, 2002, 5:30:40 PM5/27/02
to
* Aleksandr Skobelev

| So, logical pathnames is a leverage for mapping pathnames for files that
| are, in some sense, the part of a program, but it is not a leverage for
| mapping to/from any phisical pathname into an internal representation.
| Don't I misunderstand you?

I have no idea how to answer this last question. Both "yes" and "no"
appear to mean that you misunderstand me. Consequently, I do not even
know whether you have stated something you believe or something you do
not believe.

The key is: You do _not_ map physical pathnames to logical.

Stefan Schmiedl

unread,
May 28, 2002, 1:39:09 AM5/28/02
to
On Mon, 27 May 2002 20:53:52 GMT,
Erik Naggum <er...@naggum.net> wrote:
> Why are you using logical pathnames when you get input pathnames from the
> user? What part of "one-way mapping" did you not understand? *sigh*

Another bit fell into place ... thanks for the nudge.

s.

0 new messages