[Issue 8909] is{File, Dir, SymLink} mix return error code and exception

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Oct 29 12:02:32 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=8909



--- Comment #2 from Dimitri Sabadie <dimitri.sabadie at gmail.com> 2012-10-29 12:02:26 PDT ---
(In reply to comment #1)
> I believe that the only reason that they'll throw is if they fail to stat the
> file, and it makes perfect sense IMHO for them to throw in that case. Neither
> true nor false would be correct if the file doesn't even exist in the first
> place. As long as you check that the file exists in the first place, you
> shouldn't need to worry about them throwing exceptions.

I think you’re wrong, because when we use a property or function called is*, we
don’t expect it to throw exception. I personally don’t and I thank it’s insane
to do so. Furthermore, the fact that is{File,Dir,SymLink} « stats » a file is
an implementation detail thus we don’t have to know anything stat relevant.
Then your argument about stat failure is not out of topic IMHO. If the property
actually fails to stat a file, we don’t really care about why. If we do, I
think a set of more specialized function should be used.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list