Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ Language Reference - findnext http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
   findnext

   Usage
   #include <dos.h>
   struct FIND *findnext(void);

   Description
   The  system  calls  findfirst  and findnext are  used  to  find  files
   matching  a file description possibly containing wild cards (i.e.  '*'
   or '?'). The wild cards can be in the file name or extension, but  not
   the path. The attribute argument is the file attribute of the files to
   be found. The attribute bits are defined in dos.h (see findfirst)

   A  value of 0 for the attribute will find all normal files. A  pointer
   to  a  static structure (defined in dos.h) is returned  upon  success,
   otherwise a NULL is returned. The pointer to the returned structure is
   static, so if the information is needed after a call to findnext, then
   the  structure  must  be copied to another  buffer.  The  system  call
   findnext  gets  the  next  match of the file  name  specified  in  the
   preceding  findfirst  call.  findnext  must be  called  only  after  a
   findfirst call.
   Example

   #include <stdio.h>
   #include <dos.h>
   main()
   {
   struct FIND *p;
        printf("Directory listing of *.*\n");
        p = findfirst("*.*",0);
        while(p)
        {
             printf(" %s\n",p->name);
             p = findnext();
        }
   }

   Return Value
   A  pointer to a static struct FIND as defined in dos.h is returned  on
   success and a NULL pointer to indicate the end of filename matches  or
   an error.


Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson