Hopefully this will not jump around and it will make sense.
-
Does anyone know how many open concurrent FTP connections are allowed on one windows based PC?
-
In Python/Jython when using the FTP, I can not seem to find the time out period. I would like to reduce it down from like 20 sec to like 5 or 10 but where is it?
-
Lets say you use a commercial FTP client like CuteFTP or WSFTP. Why does it seem to transfer the data faster than say if you write script in Python/Jython?
for i in range(20):
try:
string = '10.0.0.'+str(i)
k=i-10
filename = 'MACH_0'+str(k)+'.CSV'
from ftplib import FTP
ftp = FTP(string)
ftp.login('david','bigbrother')
print"Downloading :"+filename
ftp.set_pasv(0)
ftp.retrbinary('RETR ' + filename,open(filename,'wb').write)
print"accept",i
except:
print"deny",i
Above is the code I have come up with so far and it seems to work well for some and not so good for others. The area I am having trouble with is in the file name. Locations 1 to 9 have a leading 0 (zero) while the other do not. How can I program in that if the number is less than or equal to 9 add the leading zero and if it is greater than 9 then just use the number?
Is there a way to say that while one file is downloading it will continue searching for another one an could keep tabs on how many so that the cap is not exceeded, that is if there is a cap.
Thanks one and all. Have a great weekend.