Re: [AD] SF.net SVN: alleg:[11393] allegro/branches/4.9 |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: "Coordination of admins/developers of the game programming library Allegro" <alleg-developers@xxxxxxxxxx>
- Subject: Re: [AD] SF.net SVN: alleg:[11393] allegro/branches/4.9
- From: Thomas Fjellstrom <tfjellstrom@xxxxxxxxxx>
- Date: Tue, 6 Jan 2009 10:30:14 -0700
On January 6, 2009, Peter Hull wrote:
> 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)
Indeed. So I guess I have a few things to tweak.
> Pete
>
--
Thomas Fjellstrom
tfjellstrom@xxxxxxxxxx