DosFindClose (OS/2 1.x): Difference between revisions
Appearance
m Ak120 moved page OS2 API:CPI:LEGACY:DosFindClose to DosFindClose (OS/2 1.x) |
mNo edit summary |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
This call closes the association between a directory handle and a [[DosFindFirst (FAPI)|DosFindFirst]] or [[DosFindNext (FAPI)|DosFindNext]] directory search function. | |||
This call closes the association between a directory handle and a DosFindFirst or DosFindNext directory search function. | |||
==Syntax== | ==Syntax== | ||
DosFindClose (DirHandle) | |||
DosFindClose | |||
==Parameters== | ==Parameters== | ||
; | ;DirHandle ([[HDIR]]) - input : bHandle previously associated with a DosFindFirst by the system, or used with a DosFindNext directory search function. | ||
==Return Code== | ==Return Code== | ||
;rc (USHORT) - return:Return code descriptions are: | |||
*0 NO_ERROR | |||
Return code descriptions are: | *6 ERROR_INVALID_HANDLE Remarks | ||
* 0 | |||
* 6 | |||
==Remarks== | ==Remarks== | ||
When DosFindClose is issued, a subsequent DosFindNext for the closed DirHandle fails unless an intervening DosFindFirst has been issued specifying DirHandle. | When ''DosFindClose'' is issued, a subsequent ''DosFindNext'' for the closed DirHandle fails unless an intervening DosFindFirst has been issued specifying DirHandle. | ||
== | ==Bindings== | ||
===C | ===C=== | ||
<PRE> | <PRE> | ||
#define INCL_DOSFILEMGR | #define INCL_DOSFILEMGR | ||
Line 29: | Line 22: | ||
USHORT rc = DosFindClose(DirHandle); | USHORT rc = DosFindClose(DirHandle); | ||
HDIR | HDIR DirHandle; /* Directory search handle */ | ||
USHORT rc; /* return code */ | |||
</PRE> | |||
===MASM=== | |||
<PRE> | |||
EXTRN DosFindClose:FAR | |||
INCL_DOSFILEMGR EQU 1 | |||
PUSH WORD DirHandle ;Directory search handle | |||
CALL DosFindClose | |||
Returns WORD | |||
</PRE> | </PRE> | ||
==Example== | |||
This example searches for a file, then closes the search. | |||
<PRE> | <PRE> | ||
#define INCL_DOSFILEMGR | #define INCL_DOSFILEMGR | ||
Line 57: | Line 59: | ||
rc = DosFindClose(FindHandle); /* Directory search handle */ | rc = DosFindClose(FindHandle); /* Directory search handle */ | ||
</PRE> | </PRE> | ||
[[Category: | [[Category:Dos16]] |
Latest revision as of 03:28, 26 January 2020
This call closes the association between a directory handle and a DosFindFirst or DosFindNext directory search function.
Syntax
DosFindClose (DirHandle)
Parameters
- DirHandle (HDIR) - input
- bHandle previously associated with a DosFindFirst by the system, or used with a DosFindNext directory search function.
Return Code
- rc (USHORT) - return
- Return code descriptions are:
- 0 NO_ERROR
- 6 ERROR_INVALID_HANDLE Remarks
Remarks
When DosFindClose is issued, a subsequent DosFindNext for the closed DirHandle fails unless an intervening DosFindFirst has been issued specifying DirHandle.
Bindings
C
#define INCL_DOSFILEMGR USHORT rc = DosFindClose(DirHandle); HDIR DirHandle; /* Directory search handle */ USHORT rc; /* return code */
MASM
EXTRN DosFindClose:FAR INCL_DOSFILEMGR EQU 1 PUSH WORD DirHandle ;Directory search handle CALL DosFindClose Returns WORD
Example
This example searches for a file, then closes the search.
#define INCL_DOSFILEMGR #define SEARCH_PATTERN "*.*" #define FILE_ATTRIBUTE 0 #define RESERVED 0L HDIR FindHandle; FindHandle = 0x0001; FindCount = 1; rc = DosFindFirst(SEARCH_PATTERN, /* File pattern */ &FindHandle, /* Directory search handle */ FILE_ATTRIBUTE, /* Search attribute */ &FindBuffer, /* Result buffer */ sizeof(FindBuffer), /* Result buffer length */ &FindCount, /* # of entries to find */ RESERVED); /* Reserved (must be zero) */ rc = DosFindClose(FindHandle); /* Directory search handle */