From: Frank Tamborello
Subject: request for lisp help: writing streams to files in MCL
Date: 
Message-ID: <evglo3$mhr$3@joe.rice.edu>
Howdy.

I'm a Lisp greenhorn who'd like to learn how to write streams of text 
to files. I'm having trouble with the little program I'm writing 
(below) for Macintosh Common Lisp. When I call (write-data-file), I 
want it to write "This is a data file. w00t." to 1.txt in 
/Users/frank/School/Lisp/data/. However, when I call (write-data-file), 
the listener instead barfs at me:

? (write-data-file)
> Error: Cannot create #P"/Users/frank/School/Lisp/data/:"
> While executing: CCL::DIRPATH-TO-FILEPATH

Why can't MCL create the path? This seems to be something specific to 
MCL, as the thing actually works in OpenMCL 1.0. Any suggestions will 
be appreciated!


(setf path (make-pathname :directory "/Users/frank/School/Lisp/data/" 
:name "1.txt"))
;; That's actually supposed to be the directory, "Lisp" inside the 
directory "School". I don't know why my news reader is not letting me 
type "School / Lisp" without spaces! }8^[

(defun write-data-file ()
       (with-open-file (str path
         :direction :output :if-exists :supersede)
         (format str "This is a data file. w00t.")))

From: Rainer Joswig
Subject: Re: request for lisp help: writing streams to files in MCL
Date: 
Message-ID: <joswig-295A24.20544310042007@news-europe.giganews.com>
In article <············@joe.rice.edu>,
 Frank Tamborello <tambo @ rice . edu> wrote:

> Howdy.
> 
> I'm a Lisp greenhorn who'd like to learn how to write streams of text 
> to files. I'm having trouble with the little program I'm writing 
> (below) for Macintosh Common Lisp. When I call (write-data-file), I 
> want it to write "This is a data file. w00t." to 1.txt in 
> /Users/frank/School/Lisp/data/. However, when I call (write-data-file), 
> the listener instead barfs at me:
> 
> ? (write-data-file)
> > Error: Cannot create #P"/Users/frank/School/Lisp/data/:"
> > While executing: CCL::DIRPATH-TO-FILEPATH
> 
> Why can't MCL create the path? This seems to be something specific to 
> MCL, as the thing actually works in OpenMCL 1.0. Any suggestions will 
> be appreciated!
> 
> 
> (setf path (make-pathname :directory "/Users/frank/School/Lisp/data/" 
> :name "1.txt"))
> ;; That's actually supposed to be the directory, "Lisp" inside the 
> directory "School". I don't know why my news reader is not letting me 
> type "School / Lisp" without spaces! }8^[
> 
> (defun write-data-file ()
>        (with-open-file (str path
>          :direction :output :if-exists :supersede)
>          (format str "This is a data file. w00t.")))

Read the MCL documentation about pathnames.
MCL probably still uses older Mac pathnames and not
Unix pathnames.

Mac pathnames have different roots and directory
character is : and not / . The documentation
will explain it.

I think a path will look like "diskname:subdir:subdir1:test.text".

-- 
http://lispm.dyndns.org
From: ········@comcast.net
Subject: Re: request for lisp help: writing streams to files in MCL
Date: 
Message-ID: <1176529602.906489.112150@y80g2000hsf.googlegroups.com>
I believe MCL 4.x is written for OS9 (classic) and subsequent versions
work in OS10. The former is colon-delimited as Rainer has shown and
the latter slash-delimited like any other Unix platform. First, find
out what version you are running.