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: Christian Kellermann
Subject: Re: [Chicken-hackers] [PATCH] handle EOVERFLOW and ENOTDIR gracefully in file/directory-exists?
Date: Sat, 8 Oct 2011 21:09:26 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

* 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

-- 
Who can (make) the muddy water (clear)? Let it be still, and it will
gradually become clear. Who can secure the condition of rest? Let
movement go on, and the condition of rest will gradually arise.
 -- Lao Tse. 



reply via email to

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