ftp connection and commands (directroy size, etc)

maxou maximillou at msn.com
Wed Apr 12 12:33:09 EDT 2006


Hello Arne

> 1. Connecting to ftp is OK

> 2. Getting the directory structure and the size of each directory in the
> root

-If you want to get the structure of your directory you can simply do
this:

print ftp.dir(path_of_your_directory)
or by creating a list do this
a=ftp.dir(path_of_your_directory)
print a

- To get the size do this:

import os.path
size_directory=os.path.getsize(name_of_directory)
or 
size_file=os.path.getsize(name_of_file)


Max




More information about the Python-list mailing list