52 lines
695 B
C
Raw Normal View History

/* Include standard libftp's header */
1995-05-30 05:51:47 +00:00
#include <FtpLibrary.h>
main(int argc, char *argv[])
{
FILE *input,*output;
int c;
1995-05-30 05:51:47 +00:00
if (argc<3)
exit(fprintf(stderr,"Usage: %s input-file output-file\n",argv[0]));
FtplibDebug(yes);
1995-05-30 05:51:47 +00:00
if ((input=Ftpfopen(argv[1],"r"))==NULL)
{
perror(argv[1]);
exit(1);
}
1995-05-30 05:51:47 +00:00
if ((output=Ftpfopen(argv[2],"w"))==NULL)
{
perror(argv[2]);
exit(1);
}
1995-05-30 05:51:47 +00:00
while ( (c=getc(input)) != EOF && (putc(c,output)!=EOF) );
if (ferror(input))
{
perror(argv[1]);
exit(1);
}
1995-05-30 05:51:47 +00:00
if (ferror(output))
{
perror(argv[1]);
exit(1);
}
Ftpfclose(input);
Ftpfclose(output);
exit(0);
1995-05-30 05:51:47 +00:00
}