[AD] al_findfirst() win2k.

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


problem:

al_findfirst() does not behave as the docs say it does, and this caused my hours or grief.

in  /allegro/docs/html/alleg028.html#al_findfirst

it says "Similarly, if you pass 'FA_ARCH' then both archived and non-archived files will be included. "

if i use FA_ARCH it only finds files with the archive bit set.
how do i find both FA_ARCH and non-FA_ARCH files ?

i write the following to test this:
it searches for all the *.TXT files in the current wd.


--------------- snip here ----------------
#include <allegro.h>
#include <stdio.h>
int main(void)
{
	allegro_init();
	al_ffblk blk;
	if ( 0 != al_findfirst("*.txt", &blk, FA_ARCH | FA_RDONLY ))
	{
		printf("no match found\n");
		return 2;
	}
	printf("name = %s\n", blk.name );

	while ( 0 == al_findnext(&blk))
	{
		printf("name = %s\n", blk.name );
	}
	return 0;
}
------------------- snip here --------------------

i compiled it with djgpp using
gpp f.cpp -lalleg

im using  win2k, WIP 4.1.6.



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