Allegro.cc - Online Community

Allegro.cc Forums » Allegro Development » Al_findfirst documentation

This thread is locked; no one can reply to it. rss feed Print
Al_findfirst documentation
Richard Phipps
Member #1,632
November 2001
avatar

In the current Allegro documentation I see this:

Quote:

if (al_findfirst("*.pcx", &info, 0) != 0) {
/* Tell user there are no PCX files. */
return;
}

But this is not correct. The attributes flag (the 0) needs to be set to one of the flag fields or 0xFF to pass all attributes. Otherwise the above code will find no files. (At least for me anyway!)

Would it be possible to correct this in the docs?
Thanks!
Rich.

Fiddler
Member #5,385
January 2005

It would be really nice if you could provide a patch with the proposed change. Find the ._tx file in the documentation folder, make the change, and use the online patcher to make a patch file against the current docs. Then post it either in the AD list or here.

This way you can ease some of the burden off Allegro developers. And you'll get mentioned in the docs, too!

The Open Toolkit: a game development library for .Net/Mono.
http://www.opentk.com

Matthew Leverton
Supreme Loser
January 1999
avatar

Quote:

Otherwise the above code will find no files.

But that is what it claims it is doing! So it really is correct, although in a very evil way. ;)

Evert
Member #794
November 2000
avatar

Quote:

The attributes flag (the 0) needs to be set to one of the flag fields or 0xFF to pass all attributes. Otherwise the above code will find no files. (At least for me anyway!)

It will if you pass FA_ARCH as a flag; your PCX files probably have this flag set. Maybe we should have an FA_ANY that comes down to 0xFF to specify we want to match all files?
Personally, I think the system is complicated anyway. I would personally expect the flags to either specify files we want to match or files to include, right now they work to exclude the flags you didn't specify, which I find confusing.

Quote:

Would it be possible to correct this in the docs?

Sure. Proposed patch attacehd.

Peter Wang
Member #23
April 2000

FA_ANY can be written ~0, but it seems like a good addition.

Go to: