chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-hackers] [PATCH] handle EOVERFLOW and ENOTDIR gracefully in


From: John Cowan
Subject: Re: [Chicken-hackers] [PATCH] handle EOVERFLOW and ENOTDIR gracefully in file/directory-exists?
Date: Sat, 8 Oct 2011 16:30:12 -0400
User-agent: Mutt/1.5.18 (2008-05-17)

Alan Post scripsit:

> > No.  If ENAMETOOLONG is returned, the file can't possibly exist (because
> > the filesystem has no way to represent it), so it's always correct to
> > return #f in that case.
>
> (I'm sorry this got divided into three messages!  I'm typing faster
> than I'm thinking...)

Slow down a bit, then.

Here's my argument:  file-exists? should return #t if the file definitely
exists and #f if it definitely doesn't, and should throw an exception
if the implementation cannot tell.  In the case of ENAMETOOLONG, the
file *cannot* exist, so returning #f (and not throwing an exception)
is the Right Thing.

--
John Cowan   http://ccil.org/~cowan    address@hidden
We want more school houses and less jails; more books and less arsenals;
more learning and less vice; more constant work and less crime; more
leisure and less greed; more justice and less revenge; in fact, more of
the opportunities to cultivate our better natures.  --Samuel Gompers



reply via email to

[Prev in Thread] Current Thread [Next in Thread]