home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume38 / libftp / part01 / FtpRetr.c < prev    next >
C/C++ Source or Header  |  1993-07-13  |  375b  |  19 lines

  1. #include "FtpLibrary.h"
  2.  
  3. STATUS FtpRetr(FTP * con , char * command , char *in , char * out)
  4. {
  5.   FILE *o;
  6.   int c;
  7.   
  8.   if ( FtpData(con,command,in,"r") < 1 )
  9.     return con->errno;
  10.  
  11.   if ( (o=fopen(out,"w")) == NULL )
  12.     return EXIT(con,QUIT);
  13.   while ( (c=FtpRead(con)) != EOF )
  14.     putc(c,o);
  15.   if ( c != EOF ) return con -> errno ;
  16.   fclose(o);
  17.   return FtpClose(con);
  18. }
  19.