Making a directory from a pathname

Джерело:
Common Lisp Tips

Дата публікації:
14/11/2015 21:08

Постійна адреса новини:
http://www.vsinovyny.com/8323846

Making a directory from a pathname

 

14/11/2015 21:08 // Common Lisp Tips

Sometimes I want to create a directory pathname relative to some existing file pathname. For example, when I want to refer to files that are in the same directory as the currently loading file, I might work relative to *load-truename*.

I used to do it like this:

(make-pathname :directory (pathname-directory *load-truename*))

This worked fine for me, but after getting bug reports from Windows users, I’ve changed it to this:

(make-pathname :defaults *load-truename*
               :type nil
               :name nil
               :version nil)

That way all the properties of *load-truename* are carried over, except the name and type.

edit Added :version nil per Fare’s comment.

 

» Читати повністю

 

« Наступна новина з архіву
The return value of read-sequence
  Попередня новина з архіву
When a synonym-stream is useful
»

 

 
© 2026 www.vsinovyny.com