TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: All
from: Francois Thunus
date: 1996-10-05 18:54:00
subject: silly findfirst question

Hello All!

>----- Begin -----

/* test of findfirst / findnext under emx */

#include 

#define FindCount  1
#define FindHandle 1
#define FindLevel  1

int main(int argc, char **argv)
{
   int          F_A;
   char         *Search;
   FILEFINDBUF3 *FindBuf;
   int          Done;

   F_A=0;
   Done=0;
   FindBuf=malloc(sizeof(FILEFINDBUF3));
   strcpy(Search,argv[1]);
  
Done=DosFindFirst(Search,&FindHandle,F_A,FindBuf,sizeof(FILEFINDBUF3),&FindC
ount,FindLevel);
   while(Done==0)
   {
     printf("file: %s\n",&FindBuf->achName);
     Done=DosFindNext(FindHandle,FindBuf,sizeof(FILEFINDBUF3),&FindLevel);
     }

   return(0);
}

>-----  End  -----

This works as advertised when compiled to os/2 EXE with Emx.
However
1) I'm getting a warning
"assignment makes pointer from integer without a cast" on the malloc line
why ? I've always done that under dos and my compiler never complained ?

2) when compiled to dual standart (ie dos/os/2 exe with rsx/emx.dll) it
still works under os/2 but bombs out with GP in a dos box. Related to
previous ? what to do ?

Thanks

                             -= Francois =-
                       Thunus{at}Club.TeleMatique.org
                      http://www.telematique.org/ft
"You think you've got problems." -- Ford

--- GoldED 2.51.A0901+
* Origin: Xara Sto Pragma ! Gasperich - Luxembourg -> (FidoNet 2:270/25.2)
SEEN-BY: 50/99 270/101 620/243 625/100 711/401 409 410 413 430 808 809 934
SEEN-BY: 711/955 712/407 515 624 628 713/888 800/1
@PATH: 270/25 170/400 396/1 270/101 712/515 711/808 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.