From: Vassil Nikolov
Subject: Re: namestring to pathname and back
Date: 
Message-ID: <l03130301b3ed46100169@195.138.129.116>
(Seems this didn't make it on the first attempt, resending.)

Duane Rettig wrote:                [1999-08-26 08:48 -0700]

  > Vassil Nikolov <ยทยทยท@einet.bg> writes:
  > 
  > > * provide a function that `translates' a Lisp pathname designator into
  > >   am operating system filename (this functionality is present in a
  > >   Lisp implementation anyway since it must be able to construct
  > >   OS-level filenames from Lisp pathnames in order to make system
  > >   calls).
  > 
  > The real problem with this requirement/request is the assumption
  > that the filename eventually passed to the operating system fully
  > specifies the desired file.

There is no such assumption.  The reason for this requirement, request,
wish, or whatever, is to have a way of knowing what happens between
the Lisp implementation and the operating system so that one can
apply from that point on knowledge about the behaviour of the operating
system to find out what happens to the file.

  |...|
  > There is no unix or windows function that I know of which is
  > equivalent to what you are asking for in lisp, which, given a
  > file name string will return the precise name of the file being
  > opened (perhaps it would better be specified as a filesystem/inode
  > pair, for most precision, but even that is a can of worms in the
  > presence of distributed filesystems).  Thus, the idea of getting
  > "the real file name" is, I believe, misguided, since it will never
  > yield an answer you can count on.

I never imagined that by having such functionality I would get `the
real file name'; if anything I wrote suggested that, that was quite
inadvertent.  That functionality would only get me `the real
argument to the file system interface,' so that I can speak the
language of the operating system if I want.  That means that
once I have the `string to host' (in Lisp Machine terminology
that I have just learned from Kent Pitman and that I hope I am
using correctly), I only need knowledge about the OS to find out
where my file is (or to tell other non-Lisp programs about my
file).  It may require a lot of work to do that, but at least I would
have gotten maximum assistance from Lisp for that.

While there isn't a Unix or Windows function that would provide
the `true file name,' by sufficient reading of the documentation
one can collect enough knowledge about Unix (I dare not say the
same about Windows...) in order to be able to find that true name
at least in most cases.  It becomes harder, however, if one does
not have the exact file name with which the operating system
started.

In any case, Lisp's file system interface does call the operating
system's file system interface and does pass file names to it
that it produces from Lisp pathnames, therefore this functionality
exists at least internally in the Lisp implementation.


Vassil Nikolov.  (See header for additional contact information.)
  Abaci lignei --- programmatici ferrei.




 Sent via Deja.com http://www.deja.com/
 Share what you know. Learn what you don't.