This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# download for anonymous user | |
from ftplib import FTP | |
ftp = FTP('') | |
ftp.connect('localhost',1026) # connect to host, default port | |
ftp.login() # login as anonymous user | |
ftp.cwd('anonymous') # change into "files" directory | |
print ("Permissions No. Owner Type Size Date Time Filename") | |
ftp.retrlines('LIST') # retrieve list of file in the directory |