Jump to content

DosFindClose (OS/2 1.x): Difference between revisions

From EDM2
Ak120 (talk | contribs)
Ak120 (talk | contribs)
mNo edit summary
Line 1: Line 1:
==Description==
This call closes the association between a directory handle and a DosFindFirst or DosFindNext directory search function.
This call closes the association between a directory handle and a DosFindFirst or DosFindNext directory search function.


==Syntax==
==Syntax==
<PRE>
  DosFindClose (DirHandle)
  DosFindClose


    (DirHandle)
</PRE>
==Parameters==
==Parameters==
; DirHandle (HDIR) - input : bHandle previously associated with a DosFindFirst by the system, or used with a DosFindNext directory search function.
;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
  rc (USHORT) - return
Return code descriptions are:
Return code descriptions are:
 
* 0 NO_ERROR
* 0       NO_ERROR
* 6 ERROR_INVALID_HANDLE Remarks
* 6       ERROR_INVALID_HANDLE Remarks


==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.


==Example Code==
==Example Code==
Line 30: Line 24:


HDIR            DirHandle;    /* Directory search handle */
HDIR            DirHandle;    /* Directory search handle */
USHORT          rc;            /* return code */
USHORT          rc;            /* return code */
</PRE>
</PRE>
'''Example'''
'''Example'''


This example searches for a file, then closes the search.  
This example searches for a file, then closes the search.
 
<PRE>
<PRE>
#define INCL_DOSFILEMGR
#define INCL_DOSFILEMGR
Line 57: Line 49:
   rc = DosFindClose(FindHandle);          /* Directory search handle */
   rc = DosFindClose(FindHandle);          /* Directory search handle */
</PRE>
</PRE>
===MASM Binding===
===MASM Binding===
<PRE>
<PRE>
Line 67: Line 60:
Returns WORD
Returns WORD
</PRE>
</PRE>
==Related Functions==
*


[[Category:The OS/2 API Project]]
[[Category:Dos]]

Revision as of 13:46, 1 March 2017

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.

Example Code

C Binding

#define INCL_DOSFILEMGR

USHORT  rc = DosFindClose(DirHandle);

HDIR             DirHandle;     /* Directory search handle */
USHORT           rc;            /* return code */

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 */

MASM Binding

EXTRN  DosFindClose:FAR
INCL_DOSFILEMGR     EQU 1

PUSH   WORD    DirHandle     ;Directory search handle
CALL   DosFindClose

Returns WORD