home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume38 / libftp / part01 / fcp.c next >
Encoding:
C/C++ Source or Header  |  1993-07-13  |  453 b   |  27 lines

  1. #include "FtpLibrary.h"
  2.  
  3. main(int a,char **b)
  4. {
  5.   FILE *out,*in;
  6.   int c;
  7.   
  8.  
  9.   if ( a != 3 )
  10.     {
  11.       fprintf(stderr,
  12.           "Usage: %s node/user/pass:input-file node/user/pass:out-file\n",
  13.           b[0]);
  14.       exit(1);
  15.     }
  16.   if ((in=FtpFullOpen(b[1],"r"))==NULL)
  17.     perror(b[1]),exit(1);
  18.   if ((out=FtpFullOpen(b[2],"w"))==NULL)
  19.     perror(b[2]),exit(1);
  20.  
  21.   
  22.   while((c=getc(in))!=EOF)
  23.     putc(c,out);
  24.   FtpFullClose(in);
  25.   FtpFullClose(out);
  26. }
  27.