internet application programming close(closes the ftp connection after this has been invokedno further operations can be performed on the ftp object connect(host [port [timeout]]opens an ftp connection to given host and port host is string specifying the host name port is the integer port number of the ftp server and defaults to port timeout is the timeout period in seconds it is not necessary to call this if host name was already given to ftp( cwd(pathnamechanges the current working directory on the server to pathname delete(filenameremoves the file filename from the server dir([dirname [[callback]]]generates directory listing as produced by the 'listcommand dirname optionally supplies the name of directory to list in additionif any additional arguments are suppliedthey are simply passed as additional arguments to 'listif the last argument callback is functionit is used as callback function to process the returned directory listing data this callback function works in the same way as the callback used by the retrlines(method by defaultthis method prints the directory list to sys stdout login([user[passwd [acct]]]logs in to the server using the specified usernamepasswordand account user is string giving the username and defaults to 'anonymouspasswd is string containing the password and defaults to the empty string 'acct is string and defaults to the empty string it is not necessary to call this method if this information was already given to ftp( mkd(pathnamecreates new directory on the server ntransfercmd(command [rest]the same as transfercmd(except that tuple (socksizeis returned where sock is socket object corresponding to the data connection and size is the expected size of the data in bytesor none if the size could not be determined pwd(returns string containing the current working directory on the server quit(closes the ftp connection by sending the 'quitcommand to the server rename(oldname,newnamerenames file on the server lib fl ff