home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / prof_c / 05oslib / dos / first_fm.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-08-11  |  448 b   |  23 lines

  1. /*
  2.  *    first_fm - find first file match in work directory
  3.  */
  4.  
  5. #include <dos.h>
  6. #include <local\doslib.h>
  7.  
  8. int
  9. first_fm(path, fa)
  10. char *path;    /* pathname of directory */
  11. int fa;        /* attribute(s) of file to match */
  12. {
  13.     union REGS inregs, outregs;
  14.  
  15.     /* find first matching file */
  16.     inregs.h.ah = FIND_FIRST;
  17.     inregs.x.cx = fa;        
  18.     inregs.x.dx = (unsigned int)path;
  19.     (void)intdos(&inregs, &outregs);
  20.  
  21.     return (outregs.x.cflag);
  22. }
  23.