Re: [AD] SF.net SVN: alleg:[11393] allegro/branches/4.9

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Tue, Jan 6, 2009 at 2:11 PM, Thomas Fjellstrom <tfjellstrom@xxxxxxxxxx> wrote:
> I have no problems with changing it.. But I thought actually being able to
> distinguish between a negative condition and a failure was important. I'm not
> so sure now.
I think it should return non-zero for 'file exists' and zero for
'doesn't exist or error'. The lazy programmer can just do
if (al_path_exists(f))  { X } else { Y };
and the diligent programmer can call al_get_errno() in the else part
to distinguish between 'no file' and 'error'.
This mirrors what stat itself does (though stat returns 0 for OK and
-1 for any error, which includes file not found)

Pete




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/