#include <string.h>
#include <setjmp.h>

#include "extern.h"
extern jmp_buf env;

filrec()
    {
		rflg = 0;

        do { rsin(); }
           while ( strncmp(rsent,sendmsg,17) );
        
        fp1 = fopen(rcv_fil,"w");
        while(1)
           {   rsin();
               if ( strncmp(rsent,filend,18) == NULL ) break;
               rflg = 1;
               fputs(rsent,fp1);
           }
        fclose(fp1);
        
        strcpy(ssent,ackmsg);
        rsout();
        
        return(0);
   }
