Re: During (load), get the directory in which the .lisp file resides
- From: Pascal Bourguignon <pjb@xxxxxxxxxxxxxxxxx>
- Date: Sat, 17 Feb 2007 20:40:15 +0100
joubert.nel@xxxxxxxxx writes:
E.g., Someone calls my file like this:
(load "/home/ublang/projects/gofer.lisp")
Then, within gofer.lisp, how do I determine the directory it is stored
in (not the OS notion of 'current directory')?
(pathname-directory *load-pathname*)
Or perhaps preferably:
(make-pathname :name nil :type nil :version nil
:defaults *load-pathname*)
if what you want is a pathname...
Of course, depending on what you want to do with the directory
pathname, you could as well just keep *load-pathname* and make or
merge pathnames with it.
--
__Pascal Bourguignon__ http://www.informatimago.com/
READ THIS BEFORE OPENING PACKAGE: According to certain suggested
versions of the Grand Unified Theory, the primary particles
constituting this product may decay to nothingness within the next
four hundred million years.
.
- Follow-Ups:
- Re: During (load), get the directory in which the .lisp file resides
- From: joubert . nel
- Re: During (load), get the directory in which the .lisp file resides
- References:
- During (load), get the directory in which the .lisp file resides
- From: joubert . nel
- During (load), get the directory in which the .lisp file resides
- Prev by Date: Re: uninterned symbols: how do they really work?
- Next by Date: First real Lisp project
- Previous by thread: During (load), get the directory in which the .lisp file resides
- Next by thread: Re: During (load), get the directory in which the .lisp file resides
- Index(es):