[comp.os.os2.programmer] Find_First/Next for DOS + OS/2

"Kenneth A. Kahn" <kenkahn@pksmrvm.vnet.ibm.com> (06/07/91)

OS/2 has two API's, DosFindFirst and DosFindNext.  They are both family APIs
which means a program compiled with them will run in both DOS and OS/2 mode.
To create a Family Application, first compile your program for OS/2 then use
the BIND utility on it to allow it to work under DOS.

cur022%cluster@ukc.ac.uk (Bob Eager) (06/07/91)

In article <9106070209.AA12081@grape.ecs.clarkson.edu>, kenkahn@pksmrvm.vnet.ibm.com (Kenneth A. Kahn) writes:
> OS/2 has two API's, DosFindFirst and DosFindNext.  They are both family APIs
> which means a program compiled with them will run in both DOS and OS/2 mode.
> To create a Family Application, first compile your program for OS/2 then use
> the BIND utility on it to allow it to work under DOS.

This is true. However, there are some problems. If you want to do a recursive
scan of a directory structure under DOS, you have to save the context in the
DTA before starting a scan of a different directory. This is done by using
the DTA-changing DOS calls, and I assume this is how the MSC _findfirst/next
works. 

There isn't a DTA under OS/2; you create handles to directories and just use
the right one to get the required context. Fine, except that if you use the
OS/2 calls (DosFindFirst/Next), under FAPI you have only one directory
handle and no way to save or restore context. I ended up writing two lots
of code that have no real overlap.
----------------------------+----------------------------------------------
Bob Eager                   | University of Kent at Canterbury
rde@ukc.ac.uk               | +44 227 764000 ext 7589
rde@ibmpcug.co.uk           |
100016.2770@compuserve.com  |
----------------------------+----------------------------------------------