<font size="2">Hello all,<br><br>I am wondering how to simply download an entire directory consisting of subdirectories and files.&nbsp; I am sure I can figure out how to &quot;walk&quot; through the directory structure, but isn&#39;t there an easier way to just suck down an entire direcotry from the FTP site?&nbsp; Here is my code and details.
<br><br>- - - - Description - - - -<br>Log into FTP<br>If a folder with todays date exists, download the entire directory to a local drectory<br>If it doesnt exist return &quot;nothing ready today&quot;<br><br>- - - - Error - - - - 
<br>ftputil.ftp_error.FTPIOError: 550 2007_11_28/: Not a regular file<br><br>- - - - Code - - - - <br></font><p class="first"><font size="2"><tt class="literal"><span class="pre"><font size="4">import ftputil<br>import os
<br>import sys<br>from time import strftime<br>from nt import mkdir<br><br>localPath = &quot;C:/Documents and Settings/USERNAME/My Documents/Downloads&quot;<br><br>#ftp host, login and password<br>host = ftputil.FTPHost(&#39;
<a href="http://ftp.host.com">ftp.host.com</a>&#39;, &#39;user&#39;, &#39;pass&#39;)<br>#host.set_directory_format(&quot;unix&quot;)<br><br>#directories on the FTP site<br>filesToDownloadFolder = &#39;subfolder01/subfolder02&#39;
<br>host.chdir(filesToDownloadFolder)<br><br>#get todays date<br>todaysDate = strftime(&quot;%Y_%m_%d/&quot;)<br>##if folder exists, download it and send email notification.&nbsp; if not, send email, &quot;nothing ready for today&quot;
<br><br>host.download(todaysDate, localPath, &#39;b&#39;)&nbsp; # remote, local, binary mode<br><br>host.close()<br></font><br></span><span class="pre"></span></tt></font></p><font size="2">Thanks,<br>Chad<br></font>