here is what I'm doing to get the long names of all the geos executable files
with a given token in the IMPEX drivers directory...
static GeodeToken mimeToken = {{MIME_DRV_TOKEN}, MIME_DRV_MFID};
static FileExtAttrDesc findMimeFEAD[] =
{{ FEA_TOKEN, &mimeToken, sizeof(GeodeToken), NULL },
{ FEA_END_OF_LIST, 0, 0, NULL }};
static FileEnumParams findMimeFEP=
{FESF_GEOS_EXECS,
(void *)FESRT_NAME,
FILE_LONGNAME_BUFFER_SIZE,
findMimeFEAD,
FE_BUFSIZE_UNLIMITED,
0,
NULL,
NULL,0,0,
0};
MemHandle mh;
word found,notHandled;
struct {
char FMR_name[FILE_LONGNAME_BUFFER_SIZE];
} *findMimeRet;
FileSetStandardPath(SP_IMPORT_EXPORT_DRIVERS);
found = FileEnum(&findMimeFEP,&mh,¬Handled);
if(found)
for(findMimeRet=MemLock(mh); found; found--,findMimeRet++)
{
/* ...process file by the name of findMimeRet->FMR_name... */
}
MemFree(mh);
This hasn't been really stress-tested yet, but it seems to work as advertised...
:-) Of course, you could do the same thing with a callback routine called once
for each file, but I tend to be careful with callbacks in the GOC interface to
Geos, because their impelementation often seems to be badly tested...
ciao marcus