Morning all.

I get your point and I had noticed the definitions of the error cases. At the same time, in which valid scenario could the write time of a file not be determined and therefore lead file-write-date to return nil?

FYI, I came across that question when I tried to execute with SBCL a piece of code written by Peter Norvig in Paradigm of AI Programming ( His auxfns.lisp ( contains this declaration:
(defun load-paip-file (file)
  "Load the binary file if it exists and is newer, else load the source."
  (let* ((src (paip-pathname file :lisp))
	 (src-date (file-write-date src))
	 (bin (paip-pathname file :binary))
	 (bin-date (file-write-date bin)))
    (load (if (and (probe-file bin) src-date bin-date (>= bin-date src-date))
The copyright statement mentions 1991. Even though it may look strange to probe the "bin" file instead of just checking that bin-date is not nil, it seems his thinking when using that (pre-ANSI?) CL was that file-write-date would not lead to an error when the targeted file does not exist.

Anyway I modified the code to make it work with SBCL.


From: edgar <>
To: Christian Wagner <>
Cc: "" <>
Sent: Tuesday, 2 July 2013, 22:44
Subject: Re: [Sbcl-bugs] [SBLC 1.1.3] file-write-date failure when file does not exist

Am Tue, 2 Jul 2013 13:12:34 +0100 (BST)
schrieb Christian Wagner <>:

> Hi.
> In SBLC 1.1.3 running on Mac OS/X 10.6.8 calling FILE-WRITE-DATE on a
> file which doesn't exist fails because of
> Following LispWorks's CL HyperSpec
> (
> I was expecting NIL to be returned.

Please read again,
where is written:

Exceptional Situations:

An error of type file-error is signaled if the file system cannot
perform the requested operation.

- edgar

The author of this email does not necessarily endorse the following
advertisements, which are the sole responsibility of the advertiser: