[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
HELP: Pathname Translations
- To: email@example.com
- Subject: HELP: Pathname Translations
- From: firstname.lastname@example.org (Scott Storkel)
- Date: Mon, 23 Aug 1993 02:46:21 GMT
- Newsgroups: comp.lang.lisp.mcl
- Organization: NETCOM On-line Communication Services (408 241-9760 guest)
Okay, I admit it, I can't make heads nor tails out of Lisp's file
system interface. I'm hoping someone can help me out with my current
problem, and point to a better explanation than Chapter 23 in [CLtL2].
Here's my immediate problem: I'm writing some code which needs to
refer to MPW libraries in order to define some foreign function
interfaces. Rather than embed absolute pathnames in the code, I'd
like to setup translations based on the following assumptions:
1. The libraries I want are stored in a subfolder of the
standard MPW 3.3 distribution. The libraries may be in
either the C library folder or the general library folder.
From the MPW folder, the paths to the relevant folders are:
I know which folder a given file will be stored in.
2. The MPW folder will be stored at the "root" level of one of
the hard disks connected to the Mac.
So, to combine Unix wildcards with Mac directories, I want something
The best thing I've been able to come up with so far is:
(setf (logical-pathname-translations "mpw")
,(car (directory "*:MPW:Libraries:CLibraries:" :directories t)))
,(car (directory "*:MPW:Libraries:Libraries:" :directories t)))
("**;*.*" ,(car (directory "*:MPW:" :directories t)))))
These translations are then used to define a list of libraries which
will be passed to ff-load:
It seems to me that there ought to be a way to do this that doesn't
involve a call to directory. Is there? How would things change if I
didn't know where the MPW folder was? What if I didn't know which
folder a given library would be stored in?
Can anyone point me to a good tutorial on the Lisp file system
interface? Steele is about as clear as mud, and all of the tutorial
books I've seen are too busy worrying about cons, car, and cdr to talk
"You know, it's 1984 all over again..."
- Guy Kawasaki, when asked about Newton