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:11:47 -0400
User-agent: Mutt/1.5.18 (2008-05-17)

Christian Kellermann scripsit:

> Wouldn't the right answer be in this case "We don't know whether this
> file exists, because some Bad Thing(tm) happened while trying to find
> out" instead of yes or no?

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.

> Depending on my use case I might be screwed either way if file-exists?
> returns a valid answer.

Only in the sense that if it returns #f you may then try to create it,
which will fail with another ENAMETOOLONG (which in this case should raise
a Scheme exception).  So you have to be prepared for create to fail even
if file-exists? returns #f (as in many other cases: permissions, e.g.)

-- 
John Cowan   http://ccil.org/~cowan  address@hidden
[P]olice in many lands are now complaining that local arrestees are insisting
on having their Miranda rights read to them, just like perps in American TV
cop shows.  When it's explained to them that they are in a different country,
where those rights do not exist, they become outraged.  --Neal Stephenson



reply via email to

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