fs.ftpfs

class fs.ftpfs.FTPFS(host='', user='', passwd='', acct='', timeout=<object object>, port=21, dircache=True, follow_symlinks=False)

Connect to a FTP server.

Parameters:
  • host – Host to connect to
  • user – Username, or a blank string for anonymous
  • passwd – Password, if required
  • acct – Accounting information (few servers require this)
  • timeout – Timeout in seconds
  • port – Port to connection (default is 21)
  • dircache – If True then directory information will be cached, speeding up operations such as getinfo, isdir, isfile, but changes to the ftp file structure will not be visible until clear_dircache() is called
clear_dircache(*args, **kwargs)

Clear cached directory information.

Parameters:path – Path of directory to clear cache for, or all directories if

None (the default)