From: Bill Clementson
Subject: Correct behavior for file-write-date?
Date: 
Message-ID: <wkptw9mypt.fsf@attbi.com>
Under CLISP, if a file doesn't exist when you try to get the time a
file was written (or created), an error is produced:

[2]> (file-write-date "dummy.txt")
*** - FILE-WRITE-DATE: file #P"C:\\usr\\home\\dummy.txt" does not exist
1. Break [11]> 

This also happens with Corman Lisp. However, both ACL and LW return
NIL. CLHS says that "An error of type file-error is signaled if the file 
system cannot perform the requested operation." So, is this a bug with
ACL & LW? 

FYI, I am using Win2000 and the latest versions of each of the Lisp 
implementations.

-- 
Bill Clementson

From: Dave Bakhash
Subject: Re: Correct behavior for file-write-date?
Date: 
Message-ID: <c29d6s91vmw.fsf@no-knife.mit.edu>
Bill Clementson <·······@attbi.com> writes:

> Under CLISP, if a file doesn't exist when you try to get the time a
> file was written (or created), an error is produced:

> This also happens with Corman Lisp. However, both ACL and LW return
> NIL. CLHS says that "An error of type file-error is signaled if the
> file system cannot perform the requested operation." So, is this a bug
> with ACL & LW?

That's not what I'm reading, exactly.  The description of
file-write-date says:

Description:

Returns a universal time representing the time at which the file
specified by pathspec was last written (or created), or returns nil if
such a time cannot be determined.

However, I also see where it describes the exceptional behavior.  I
think that the spec here is ambiguous enough for both behaviors to be
considered okay, though I would prefer an exception personally (i.e. if
the file exists, but the write-date cannot be determined, then return
NIL, but if it does not exist, then return a file-error, etc.)

--dave
From: Barry Margolin
Subject: Re: Correct behavior for file-write-date?
Date: 
Message-ID: <des99.5$9w4.1098@paloalto-snr1.gtei.net>
In article <···············@no-knife.mit.edu>,
Dave Bakhash  <·····@alum.mit.edu> wrote:
>Bill Clementson <·······@attbi.com> writes:
>
>> Under CLISP, if a file doesn't exist when you try to get the time a
>> file was written (or created), an error is produced:
>
>> This also happens with Corman Lisp. However, both ACL and LW return
>> NIL. CLHS says that "An error of type file-error is signaled if the
>> file system cannot perform the requested operation." So, is this a bug
>> with ACL & LW?
>
>That's not what I'm reading, exactly.  The description of
>file-write-date says:
>
>Description:
>
>Returns a universal time representing the time at which the file
>specified by pathspec was last written (or created), or returns nil if
>such a time cannot be determined.
>
>However, I also see where it describes the exceptional behavior.  I
>think that the spec here is ambiguous enough for both behaviors to be
>considered okay, though I would prefer an exception personally (i.e. if
>the file exists, but the write-date cannot be determined, then return
>NIL, but if it does not exist, then return a file-error, etc.)

I think the latter was our intent.  We wanted to allow for file systems
that don't keep track of modification times.

That still leaves an ambiguous case, though: the user might have permission
to determine that the file exists, but not access its modification time.
This can happen on Unix if you have read permission to the containing
directory, but not execute permission -- you can list the filenames the
directory contains, but not access any of them in any way.

I think this should also signal an error; the NIL case is best left for a
general inability to determine write dates, not a problem with the specific
file.

-- 
Barry Margolin, ······@genuity.net
Genuity, Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
From: Erik Naggum
Subject: Re: Correct behavior for file-write-date?
Date: 
Message-ID: <3239104522874900@naggum.no>
* Barry Margolin
| We wanted to allow for file systems that don't keep track of modification
| times.

  `file-write-date� takes a pathname designator as argument.  This could be a
  stream.  If this stream is not associated with a file, like a network socket
  or pipe or whatever else the operating system offers and above which the
  Common Lisp implementation has chosen to offer a stream abstraction or
  perhaps even terminal I/O, I expect `nil�.  If there is an actual file under
  that pathname designator, I expect a useful value or an error.

-- 
Erik Naggum, Oslo, Norway

Act from reason, and failure makes you rethink and study harder.
Act from faith, and failure makes you blame someone and push harder.