From: Kevin Layer

Subject: Re: make-pathname

Date: 2003-1-21 11:57

Why not just this?

(defun make-index ()
  (with-open-file (str "d:/webpage/index.html"
		   :direction :output :if-exists :supersede
		   :if-does-not-exist :create)
    (html-stream str (:html
		      (:head (:title "Test"))
		      (:body (:h1 "Test")
			     "HTML generator test.")))))

You can also specify it as "d:\\webpage\\index.html".

Jorge Tavares <dei.uc.pt at jast> wrote:

>> This is a simple question but until now I was unable to find an >> answer. Supose i want to make a function that writes into a file in a >> specified directory. >> >> For example: >> >> (defun make-index () >> (with-open-file (str (make-pathname >> :name "index.html" :directory '(:absolute >> "webpage")) >> :direction :output :if-exists :supersede >> :if-does-not-exist :create) >> (html-stream str (:html >> (:head (:title "Test")) >> (:body (:h1 "Test") >> "HTML generator test."))))) >> >> In this function, I can do what I want but with the exception of one >> minor detail: it saves the "index.html" in "C:\webpage". If I want the >> drive changed, for example "D:\webpage", what is the :absolute >> replacement? I've tried just puttng the string "D:\\webpage" but it >> always translate into "C:\<ACL DIR>\D:\webpage". >> >> What are the options for make-pathname? I've search the documentation >> but I was unable to find something this simple. >> >> >> Thanks in advance for any kind of advice, >> Jorge Tavares >> >> -- >> Jorge Tavares >> http://www.dei.uc.pt/~jast >> >> "Evolution is the best engineer." >> >> >> >>