#include <stdio.h>
#include "ftp.h"

int main()
{
	int i;
	int nRet;
	
	for(i=0;i<1000;i++)
	{
		nRet=0;
		nRet=ftp_open("172.54.242.98");
		if(nRet==1)
			continue;
		nRet=ftp_login("www","123456");
		if(nRet==1)
			continue;
			
			
		//recv file	1
		nRet=ftp_cwd("/tmp/recv/");
		if(nRet==1)
			continue;
	
		nRet=ftp_getfile("/tmp/recv/","recvfrom98.txt");	
		if(nRet==1)
			continue;
			
		nRet=ftp_putfile("/tmp/recv/","recvfrom128.txt");
		if(nRet==1)
			continue;	
		
		//recv file 2
		nRet=ftp_cwd("/tmp/send/");
		if(nRet==1)
			continue;
	
		nRet=ftp_getfile("/tmp/send/","sendfrom98.txt");	
		if(nRet==1)
			continue;
			
		nRet=ftp_putfile("/tmp/send/","sendfrom128.txt");
		if(nRet==1)
			continue;		
			
		/*	
		nRet=ftp_putfile("/tmp/","timezone.txt");
		if(nRet==1)
			continue;
		*/
		
		/*
		nRet=ftp_putfile("/usr/local/omc/src/performanceMgr/c_program/test/","mytest2.txt");
		if(nRet==1)
			continue;
		nRet=ftp_putfile("/usr/local/omc/src/performanceMgr/c_program/test/","mytest3.txt");
		if(nRet==1)
			continue;
		nRet=ftp_putfile("/usr/local/omc/src/performanceMgr/c_program/test/","mytest4.txt");
		if(nRet==1)
			continue;
		nRet=ftp_putfile("/usr/local/omc/src/performanceMgr/c_program/test/","mytest5.txt");
		if(nRet==1)
			continue;
		nRet=ftp_putfile("/usr/local/omc/src/performanceMgr/c_program/test/","mytest6.txt");
		if(nRet==1)
			continue;
		nRet=ftp_putfile("/usr/local/omc/src/performanceMgr/c_program/test/","mytest7.txt");
		if(nRet==1)
			continue;
		nRet=ftp_putfile("/usr/local/omc/src/performanceMgr/c_program/test/","mytest8.txt");
		if(nRet==1)
			continue;
		nRet=ftp_putfile("/usr/local/omc/src/performanceMgr/c_program/test/","mytest9.txt");
		if(nRet==1)
			continue;
		nRet=ftp_putfile("/usr/local/omc/src/performanceMgr/c_program/test/","mytest10.txt");
		if(nRet==1)
			continue;
		*/
		ftp_quit();
		sleep(2);
	}	
	return 0;
}
