home *** CD-ROM | disk | FTP | other *** search
/ ftp.wwiv.com / ftp.wwiv.com.zip / ftp.wwiv.com / pub / MISC / MNLDOS.ZIP / src / osmscfnd.c < prev    next >
C/C++ Source or Header  |  2004-07-18  |  659b  |  37 lines

  1. /* $Id: osmscfnd.c,v 1.1 2004/07/18 10:51:37 ozzmosis Exp $ */
  2.  
  3. #include <io.h>
  4.  
  5. char *os_findfirst(struct _filefind *pff, const char *path,
  6.                    const char *mask)
  7. {
  8.     char tmp[FILENAME_MAX];
  9.  
  10.     strcpy(tmp, path);
  11.     os_append_slash(tmp);
  12.     strcat(tmp, mask);
  13.     pff->handle = _findfirst(tmp, &pff->fileinfo);
  14.  
  15.     if (pff->handle == 0)
  16.     {
  17.         return NULL;
  18.     }
  19.     
  20.     return pff->fileinfo.name;
  21. }
  22.  
  23.  
  24. char *os_findnext(struct _filefind *pff)
  25. {
  26.     if (_findnext(pff->handle, &pff->fileinfo) == 0)
  27.         return pff->fileinfo.name;
  28.  
  29.     return NULL;
  30. }
  31.  
  32.  
  33. void os_findclose(struct _filefind *pff)
  34. {
  35.     _findclose(pff->handle);
  36. }
  37.