#!/usr/bin/python
# -*- coding: UTF-8 -*-
from ftplib import FTP
import os
import re
ftp = FTP()
ftp.connect('192.168.124.110',21)
ftp.login('root', 'cmfchina@2011')
Server_path = "/opt/test"
Client_path="C:\Users\Administrator\Desktop\m_test"
sum1 = 0
sum2 = 0
value = 0
FTP_Dir_l = []
Ftp_file_l = []
if re.search(r".*/$",Server_path):
pass
else:
Server_path = Server_path+"/"
#遍历获取FTP 上面的目录
def search_dir(start_dir):
ftp.cwd(start_dir)
FTP_Dir_l.append(ftp.pwd())
dir_res = []
ftp.dir('.', dir_res.append) #对当前目录进行dir(),将结果放入列表
for i in dir_res:
if i.startswith("d"):
global sum1