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: Alan Post
Subject: Re: [Chicken-hackers] [PATCH] handle EOVERFLOW and ENOTDIR gracefully in file/directory-exists?
Date: Sat, 8 Oct 2011 13:13:31 -0600

On Sat, Oct 08, 2011 at 09:09:26PM +0200, Christian Kellermann wrote:
> * Alan Post <address@hidden> [111008 20:58]:
> > Here would be the sort of pseudocode I mean:
> > 
> >     file = 'really-long-file-path'
> >   for-each dir in /mnt/*
> >             path = dir + file
> >             file-exists? path
> > 
> > Who knows what a user has mounted inside /mnt.  It might a
> > regretable filesystem.
> > 
> > I grant that this may not be sufficient reason to catch and
> > convert this error, though I would for exactly the use case above.
> > Thoughts?
> 
> 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?
> 
> Depending on my use case I might be screwed either way if file-exists?
> returns a valid answer.
> 
> So why decide for the user?
> 
> FWIW I had this once on a windows system where a library I relied
> on did this and it always returned false for these cases, which
> took me a long time to figure out the cause of this problem, that's
> the reason why I am biased against this. But I am open to ideas why
> this would be a good idea.
> 
> Thanks for your explanation Alan!
> 
> Christian
> 

Here is my new proposal:

Do not check for ENAMETOOLONG (I withdraw that proposal) and wait
for a user to encounter a problem in real life for which adding
an ENAMETOOLONG check would help.  If thata never happens, it's clearly
not a problem.

As such, I think the patch as written is fine.

Thank you Christian!

-Alan
-- 
.i ma'a lo bradi cu penmi gi'e du



reply via email to

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