From: Rick M. <obj...@gm...> - 2007-05-15 13:00:45
|
I think you're working too hard. I believe there's also a fnmatchcase() function that can make this even simpler. Rick On 5/15/07, Mark Miesfeld <mie...@gm...> wrote: > > On 5/15/07, Rick McGuire <obj...@gm...> wrote: > > > My biggest concern with adding this is handling of the wildcard > > characters in the file names. This will essentially require that all of the > > pattern matching be emulated compatibly by the SysFileTree code rather than > > delegated to the OS. However, I guess I was assuming more was being handled > > by the OS than I originally assumed, and see how this can be easily > > implemented in the *ix version of SysFileTree. > > > > In the current code, the file name matching is being handled by > fnmatch(). Because of that, it was relatively simple to implement. > > > if (caseless) { /* if caseless search */ > CHAR dup_d_name[IBUF_LEN+1]; /* compare upper cased copy */ > PCHAR pDest = dup_d_name; /* of the entry name */ > PCHAR pSrc = dir_entry->d_name; > > for ( ; *pSrc; pDest++, pSrc++ ) > *pDest = toupper(*pSrc); > *pDest = '\x0'; > > > if(fnmatch(filespec,dup_d_name,FNM_NOESCAPE|FNM_PATHNAME|FNM_PERIOD)==0){ > *d_name = dir_entry->d_name; /* retptr to the name location*/ > return 1; /* return success */ > } > } > else { /* else compare normally */ > > if(fnmatch(filespec,dir_entry->d_name,FNM_NOESCAPE|FNM_PATHNAME|FNM_PERIOD)==0){ > *d_name = dir_entry->d_name; /* retptr to the name location*/ > return 1; /* return success */ > } > } > -- > Mark Miesfeld > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Oorexx-devel mailing list > Oor...@li... > https://lists.sourceforge.net/lists/listinfo/oorexx-devel > > |