Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C Library Reference - <u>synopsis:</u> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <io.h>
    int _findnext( long handle,
                   struct _finddata_t *fileinfo );
    int _wfindnext( long handle,
                    struct _wfinddata_t *fileinfo );

Description:
    The _findnext function returns information on the next file whose name
    matches the filespec argument that was specified in a call to the
     _findfirst function.  The handle argument was returned by the
     _findfirst function.  The information is returned in a  _finddata_t
    structure pointed to by fileinfo.


         struct _finddata_t {
           unsigned  attrib;
           time_t    time_create;  /* -1 for FAT file systems */
           time_t    time_access;  /* -1 for FAT file systems */
           time_t    time_write;
           _fsize_t  size;
           char      name[260];
         };

    The wide-character _wfindnext function is similar to the _findnext
    function but operates on wide-character strings.


         struct _wfinddata_t {
           unsigned  attrib;
           time_t    time_create;  /* -1 for FAT file systems */
           time_t    time_access;  /* -1 for FAT file systems */
           time_t    time_write;
           _fsize_t  size;
           wchar_t   name[260];
         };


Returns:
    If successful, _findnext returns 0 otherwise, _findnext and returns -1
    and sets  errno to one of the following values:

    Constant     Meaning

ENOENT
    No matching files


Example:
    #include <stdio.h>
    #include <io.h>

    void main()
      {
        struct _finddata_t  fileinfo;
        long                handle;
        int                 rc;

        /* Display name and size of "*.c" files */
        handle = _findfirst( "*.c", &fileinfo );
        rc = handle;
        while( rc != -1 ) {
          printf( "%14s %10ld\n", fileinfo.name,
                                  fileinfo.size );
          rc = _findnext( handle, &fileinfo );
        }
        _findclose( handle );
      }

Classification:
    _findnext is DOS, _wfindnext is not DOS

Systems:
     _findnext - DOS, Windows, Win386, Win32, OS/2 1.x(all), OS/2-32

    _wfindnext - DOS, Windows, Win386, Win32, OS/2 1.x(all), OS/2-32

See Also:
    _dos_find Functions, _findclose, _findfirst, closedir, opendir, readdir

See Also: _findclose

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