en:docs:fapi:dosfindnext

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
en:docs:fapi:dosfindnext [2018/08/30 14:27] – created prokusheven:docs:fapi:dosfindnext [2021/09/18 09:01] (current) prokushev
Line 1: Line 1:
 +{{page>en:templates:fapiint}}
 +
 +====== DosFindNext ======
  
 This call locates the next set of directory entries that match the name specified in the previous DosFindFirst, DosFindFirst2, or DosFindNext call. This call locates the next set of directory entries that match the name specified in the previous DosFindFirst, DosFindFirst2, or DosFindNext call.
  
-==Syntax==+===== Syntax ===== 
 +<code c>
  DosFindNext (DirHandle, ResultBuf, ResultBufLen, SearchCount)  DosFindNext (DirHandle, ResultBuf, ResultBufLen, SearchCount)
 +</code>
  
-==Parameters== +===== Parameters =====
-;DirHandle (HDIR) - input : Handle associated with a previous DosFindFirst or DosFindNext function call. +
-;ResultBuf (PFILEFINDBUF) - output : Address of the directory search information structure. The information reflects the last DosClose or DosBufReset call. +
-:It is possible, if the EA information for a file is 64K, that the system can never be able to return the full EA information for a file. +
-:For the continuation of an FileInfoLevel 3 search, this buffer should contain input in the same format as a DosFindFirst2 FileInfoLevel 3 search. +
-;filedate (FDATE) : Structure containing the date of file creation. +
- '''Bit    Description''' +
- 15-9    Year, in binary, of file creation +
- 8-5     Month, in binary, of file creation +
- 4-0     Day, in binary, of file creation. +
-;filetime (FTIME) : Structure containing the time of file creation. +
- '''Bit    Description''' +
- 15-11   Hours, in binary, of file creation +
- 10-5    Minutes, in binary, of file creation +
- 4-0     Seconds, in binary number of two-second increments, of file creation.  +
-;fileaccessdate (FDATE) : Structure containing the date of last access. See FDATE in filedate. +
-;fileaccesstime (FTIME) : Structure containing the time of last access. See FTIME in filetime.  +
-;writeaccessdate (FDATE) : Structure containing the date of last write. See FDATE in filedate. +
-;writeaccesstime (FTIME) : Structure containing the time of last write. See FTIME in filetime. +
-;filesize (ULONG) : File size. +
-;filealloc (ULONG) : Allocated file size. +
-;fileattrib (USHORT) : Attributes of the file, defined in DosSetFileMode. +
-;length (UCHAR) : Length of the ASCIIZ name string. +
-;matchfilename (CHAR) : ASCIIZ name string for the first occurrence of FileName.+
  
-;ResultBufLen (USHORT) - input : Length of ResultBuf +  * DirHandle (HDIR) - input : Handle associated with a previous DosFindFirst or DosFindNext function call. 
 +  * ResultBuf (PFILEFINDBUF) - output : Address of the directory search information structure. The information reflects the last DosClose or DosBufReset call.
  
-SearchCount (PUSHORT) - input/output : Address of the number of matching entries requested in ResultBuf. On return, this field contains the number of entries placed into ResultBuf.+It is possible, if the EA information for a file is 64K, that the system can never be able to return the full EA information for a file. 
 + 
 +For the continuation of an FileInfoLevel 3 search, this buffer should contain input in the same format as a DosFindFirst2 FileInfoLevel 3 search. 
 + 
 +  * filedate (FDATE) : Structure containing the date of file creation. 
 + 
 +^ Bit ^ Description ^ 
 +| 15-9 | Year, in binary, of file creation | 
 +| 8-5 | Month, in binary, of file creation | 
 +| 4-0 | Day, in binary, of file creation | 
 + 
 +  * filetime (FTIME) : Structure containing the time of file creation. 
 + 
 +^ Bit ^ Description ^ 
 +| 15-11 | Hours, in binary, of file creation | 
 +| 10-5 | Minutes, in binary, of file creation | 
 +| 4-0 | Seconds, in binary number of two-second increments, of file creation | 
 + 
 +  * fileaccessdate (FDATE) : Structure containing the date of last access. See FDATE in filedate. 
 +  * fileaccesstime (FTIME) : Structure containing the time of last access. See FTIME in filetime.  
 +  * writeaccessdate (FDATE) : Structure containing the date of last write. See FDATE in filedate. 
 +  * writeaccesstime (FTIME) : Structure containing the time of last write. See FTIME in filetime. 
 +  * filesize (ULONG) : File size. 
 +  * filealloc (ULONG) : Allocated file size. 
 +  * fileattrib (USHORT) : Attributes of the file, defined in DosSetFileMode. 
 +  * length (UCHAR) : Length of the ASCIIZ name string. 
 +  * matchfilename (CHAR) : ASCIIZ name string for the first occurrence of FileName. 
 + 
 +  * ResultBufLen (USHORT) - input : Length of ResultBuf  
 + 
 +  * SearchCount (PUSHORT) - input/output : Address of the number of matching entries requested in ResultBuf. On return, this field contains the number of entries placed into ResultBuf. 
 + 
 +===== Return Code ===== 
 + 
 +rc (USHORT) - return
  
-==Return Code== 
- rc (USHORT) - return 
 Return code descriptions are: Return code descriptions are:
-* 0          NO_ERROR 
-* 6          ERROR_INVALID_HANDLE 
-* 18         ERROR_NO_MORE_FILES 
-* 26         ERROR_NOT_DOS_DISK 
-* 87         ERROR_INVALID_PARAMETER 
-* 111        ERROR_BUFFER_OVERFLOW 
-* 275        ERROR_EAS_DIDNT_FIT 
  
-==Remarks==+  * 0          NO_ERROR 
 +  * 6          ERROR_INVALID_HANDLE 
 +  * 18         ERROR_NO_MORE_FILES 
 +  * 26         ERROR_NOT_DOS_DISK 
 +  * 87         ERROR_INVALID_PARAMETER 
 +  * 111        ERROR_BUFFER_OVERFLOW 
 +  * 275        ERROR_EAS_DIDNT_FIT 
 + 
 +===== Remarks ===== 
 The file name in FileName can contain global file name characters. If no more matching files are found, an error code is returned. The file name in FileName can contain global file name characters. If no more matching files are found, an error code is returned.
  
Line 54: Line 71:
 In the case of ERROR_EAS_DIDNT_FIT, only information for the first matching entry is returned. This entry is the one whose EAs did not fit in the buffer. The information returned is in the format of that returned for InfoLevel 2. No further entries are returned in the buffer even if they could fit in the remaining space. In the case of ERROR_EAS_DIDNT_FIT, only information for the first matching entry is returned. This entry is the one whose EAs did not fit in the buffer. The information returned is in the format of that returned for InfoLevel 2. No further entries are returned in the buffer even if they could fit in the remaining space.
  
-===Family API Considerations===+==== Family API Considerations ===
 Some options operate differently in the DOS mode than in OS/2 mode. Therefore, the following restriction applies to DosFindNext when coding for the DOS mode: Some options operate differently in the DOS mode than in OS/2 mode. Therefore, the following restriction applies to DosFindNext when coding for the DOS mode:
  DirHandle must always equal 1.  DirHandle must always equal 1.
  
-==Example Code== +===== Example Code ===== 
-===C Binding=== + 
-<PRE>+==== C Binding ===
 + 
 +<code c>
 typedef struct _FDATE {   /* fdate */ typedef struct _FDATE {   /* fdate */
    
Line 103: Line 123:
  
 USHORT           rc;            /* return code */ USHORT           rc;            /* return code */
-</PRE>+</code>
  
 This example gets the 1st file in the current directory, and then gets the next file.  This example gets the 1st file in the current directory, and then gets the next file. 
-<PRE>+ 
 +<code c>
 #define INCL_DOSFILEMGR #define INCL_DOSFILEMGR
  
Line 133: Line 154:
                        sizeof(FindBuffer), /* Result buffer length */                        sizeof(FindBuffer), /* Result buffer length */
                        &FindCount);        /* # of entries to find */                        &FindCount);        /* # of entries to find */
-</PRE>+</code> 
 + 
 +==== MASM Binding ====
  
-===MASM Binding=== +<code asm>
-<PRE>+
 FDATE   struc FDATE   struc
    
Line 179: Line 201:
  
 Returns WORD Returns WORD
-</PRE>+</code>
  
  
-====== Note ======+===== Note =====
  
 Text based on [[http://www.edm2.com/index.php/DosFindNext_(FAPI)]] Text based on [[http://www.edm2.com/index.php/DosFindNext_(FAPI)]]