home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
misc
/
volume38
/
libftp
/
part01
/
get.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-07-13
|
477b
|
28 lines
#include "FtpLibrary.h"
main(int a,char **b)
{
FILE *out,*in;
String localfile;
int c;
if ( a != 2 )
{
fprintf(stderr,
"Usage: %s node/user/pass:input-file\n",
b[0]);
exit(1);
}
if ((in=FtpFullOpen(b[1],"r"))==NULL)
perror(b[1]),exit(1);
sscanf(b[1],"%*[^:]:%s",localfile);
if ((out=fopen(localfile,"w"))==NULL)
perror(b[2]),exit(1);
while((c=getc(in))!=EOF)
putc(c,out);
FtpFullClose(in);
fclose(out);
}