Message-ID: <353CE1A6.9F31B26F@lasalle.edu.co> Date: Tue, 21 Apr 1998 18:12:54 +0100 From: "MAPE." Organization: MAPE MIME-Version: 1.0 To: djgpp AT delorie DOT com Subject: Eof().TC -> ??.Djgpp!! Content-Type: multipart/alternative; boundary="------------4D545CCF286D391657F8F67E" Precedence: bulk --------------4D545CCF286D391657F8F67E Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Hi, I write to you becouse I have one problem.. I am converting a source file, that I wrote in Turbo C++ , to be builded with DJGPP and it appears that the function int eof(int handle) has no subsittute in Djgpp, which only offers int feof(FILE *file). I have tryed to use FILE *fdopen(int fd, const char *mode) thinking that fd is the handle, and then my program goes malfunctioning. Will I have to replace all the file tratement with handles by a one based on FILE pointers? Here is the fragmente of code: /*buscar en bufer nuevo y reeemplazar ocurrencias si las hay*/ do{ Kpos_buf=buscar_buf(cad_comp+Offset,ASCII_Obj); if(Kpos_buf>=0) /*Encontró una coincidencia*/ { /*Dicha coincidencia debe ser reemplazada*/ for(Num=0;Num=0); /*No hubo o no hay más coincidencias en el buffer actual, así que guardar el buffer actual y cargar el siguiente.. Se devuelve el puntero, se escribe y queda en la misma posición listo para leer el siguiente bloque*/ lseek(Handle,pos_arch,SEEK_SET); if(tamano> Miguel Angel Pérez Estrada. Ing. Diseño y Automatización, Universidad de La Salle mpereze AT atenea DOT lasalle DOT edu DOT co; http://www.lasalle.edu.co/~mpereze Apartado Aéreo 3957, Santafé de Bogotá D.C., COLOMBIA. --------------4D545CCF286D391657F8F67E Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit Hi, I write to you becouse I have one problem.. I am converting a source file,  that I wrote in Turbo C++ , to be builded with DJGPP and it appears that the function int eof(int handle) has no subsittute in Djgpp, which only offers int feof(FILE  *file). I have tryed to use  FILE *fdopen(int fd, const char *mode) thinking that fd is the handle, and then my program goes malfunctioning. Will I have to replace all the file tratement with handles by a one based on FILE pointers?
Here is the fragmente of code:

/*buscar en bufer nuevo y reeemplazar ocurrencias si las hay*/
  do{
       Kpos_buf=buscar_buf(cad_comp+Offset,ASCII_Obj);
       if(Kpos_buf>=0) /*Encontró una coincidencia*/
       {
            /*Dicha coincidencia debe ser reemplazada*/
            for(Num=0;Num<TamCad;Num++){
            *(cad_comp+Offset+Kpos_buf+Num)=ASCII_Reem[Num];}
        }
       Offset=Kpos_buf+TamCad;
  }while(Kpos_buf>=0);

  /*No hubo o no hay más coincidencias en el buffer actual,
     así que guardar el buffer actual y cargar el siguiente..
     Se devuelve el puntero, se escribe y queda en la misma posición listo para
     leer el siguiente bloque*/

   lseek(Handle,pos_arch,SEEK_SET);
   if(tamano<Buffer){
      write(Handle,cad_comp,(unsigned)(tamano));}
   else{
    write(Handle,cad_comp,(unsigned)(Buffer));}
  pos_arch+=Buffer;
 } while(pos_arch<=tamano && !eof(Handle) && Accion==2);

This portion of function works fine for me int TC++ 3.0 but I dont know wich is the replace of eof for working in Djgpp..

Thank you.

--
MAPE>> Miguel Angel Pérez Estrada.
Ing. Diseño y Automatización,  Universidad de La Salle
mpereze AT atenea DOT lasalle DOT edu DOT co; http://www.lasalle.edu.co/~mpereze
Apartado Aéreo 3957, Santafé de Bogotá D.C., COLOMBIA.
  --------------4D545CCF286D391657F8F67E--