no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
Next revision | |||
— | en:docs:fapi:dosfindnext [2018/08/30 14:27] – created prokushev | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | |||
+ | This call locates the next set of directory entries that match the name specified in the previous DosFindFirst, | ||
+ | |||
+ | ==Syntax== | ||
+ | | ||
+ | |||
+ | ==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. | ||
+ | ''' | ||
+ | | ||
+ | | ||
+ | | ||
+ | ;filetime (FTIME) : Structure containing the time of file creation. | ||
+ | ''' | ||
+ | | ||
+ | | ||
+ | | ||
+ | ; | ||
+ | ; | ||
+ | ; | ||
+ | ; | ||
+ | ;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. | ||
+ | ; | ||
+ | |||
+ | ; | ||
+ | |||
+ | ; SearchCount (PUSHORT) - input/ | ||
+ | |||
+ | ==Return Code== | ||
+ | rc (USHORT) - return | ||
+ | Return code descriptions are: | ||
+ | * 0 NO_ERROR | ||
+ | * 6 ERROR_INVALID_HANDLE | ||
+ | * 18 | ||
+ | * 26 | ||
+ | * 87 | ||
+ | * 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. | ||
+ | |||
+ | If an ERROR_BUFFER_OVERFLOW error is returned, further calls to DosFindNext will start the search from the same entry. | ||
+ | |||
+ | If an ERROR_EAS_DIDNT_FIT error is returned, then the buffer was too small to hold the EAs for the first matching entry being returned. A subsequent call to DosFindNext will get the next matching entry. This enables the search to continue if the EAs being returned are too big to fit in the buffer. You may use DosQPathInfo to retrieve the EAs for the matching entry by using the EA arguments that were used for the DosFindFirst2 call and the name that was returned by DosFindFirst2. | ||
+ | |||
+ | In the case of ERROR_EAS_DIDNT_FIT, | ||
+ | |||
+ | ===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: | ||
+ | | ||
+ | |||
+ | ==Example Code== | ||
+ | ===C Binding=== | ||
+ | <PRE> | ||
+ | typedef struct _FDATE { /* fdate */ | ||
+ | |||
+ | unsigned day : 5; /* binary day for directory entry */ | ||
+ | unsigned month : 4; /* binary month for directory entry */ | ||
+ | unsigned year : 7; /* binary year for directory entry */ | ||
+ | |||
+ | } FDATE; | ||
+ | |||
+ | typedef struct _FTIME { /* ftime */ | ||
+ | |||
+ | unsigned twosecs : 5; /* binary number of two-second increments */ | ||
+ | unsigned minutes : 6; /* binary number of minutes */ | ||
+ | unsigned hours : 5; /* binary number of hours */ | ||
+ | |||
+ | } FTIME; | ||
+ | |||
+ | typedef struct _FILEFINDBUF { /* findbuf */ | ||
+ | |||
+ | FDATE fdateCreation; | ||
+ | FTIME ftimeCreation; | ||
+ | FDATE fdateLastAccess; | ||
+ | FTIME ftimeLastAccess; | ||
+ | FDATE fdateLastWrite; | ||
+ | FTIME ftimeLastWrite; | ||
+ | ULONG cbFile; | ||
+ | ULONG cbFileAlloc; | ||
+ | USHORT attrFile; | ||
+ | UCHAR cchName; | ||
+ | CHAR | ||
+ | |||
+ | } FILEFINDBUF; | ||
+ | |||
+ | #define INCL_DOSFILEMGR | ||
+ | |||
+ | USHORT | ||
+ | |||
+ | HDIR | ||
+ | PFILEFINDBUF | ||
+ | USHORT | ||
+ | PUSHORT | ||
+ | |||
+ | USHORT | ||
+ | </ | ||
+ | |||
+ | This example gets the 1st file in the current directory, and then gets the next file. | ||
+ | <PRE> | ||
+ | #define INCL_DOSFILEMGR | ||
+ | |||
+ | #define NORMAL_FILES 0 | ||
+ | #define SEARCH_PATTERN " | ||
+ | #define FILE_ATTRIBUTE NORMAL_FILES | ||
+ | #define RESERVED 0L | ||
+ | |||
+ | HDIR FindHandle; | ||
+ | FILEFINDBUF FindBuffer; | ||
+ | USHORT | ||
+ | USHORT | ||
+ | |||
+ | | ||
+ | | ||
+ | |||
+ | | ||
+ | & | ||
+ | FILE_ATTRIBUTE, | ||
+ | & | ||
+ | sizeof(FindBuffer), | ||
+ | & | ||
+ | RESERVED)) | ||
+ | rc = DosFindNext(FindHandle, | ||
+ | & | ||
+ | | ||
+ | & | ||
+ | </ | ||
+ | |||
+ | ===MASM Binding=== | ||
+ | <PRE> | ||
+ | FDATE struc | ||
+ | |||
+ | fdate_fs | ||
+ | |||
+ | FDATE ends | ||
+ | |||
+ | FTIME struc | ||
+ | |||
+ | ftime_fs | ||
+ | |||
+ | FTIME ends | ||
+ | |||
+ | FILEFINDBUF struc | ||
+ | |||
+ | findbuf_fdateCreation | ||
+ | findbuf_ftimeCreation | ||
+ | findbuf_fdateLastAccess dw (size FDATE)/2 dup (?) ;file date of | ||
+ | ; | ||
+ | findbuf_ftimeLastAccess dw (size FTIME)/2 dup (?) ;file time of | ||
+ | ; | ||
+ | findbuf_fdateLastWrite | ||
+ | ; | ||
+ | findbuf_ftimeLastWrite | ||
+ | ; | ||
+ | findbuf_cbFile | ||
+ | findbuf_cbFileAlloc | ||
+ | findbuf_attrFile | ||
+ | findbuf_cchName | ||
+ | findbuf_achName | ||
+ | |||
+ | FILEFINDBUF ends | ||
+ | |||
+ | EXTRN DosFindNext: | ||
+ | INCL_DOSFILEMGR | ||
+ | |||
+ | PUSH | ||
+ | PUSH@ OTHER | ||
+ | PUSH | ||
+ | PUSH@ WORD SearchCount | ||
+ | CALL | ||
+ | |||
+ | Returns WORD | ||
+ | </ | ||
+ | |||
+ | |||
+ | ====== Note ====== | ||
+ | |||
+ | Text based on [[http:// | ||
+ | |||
+ | {{page> | ||