<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="HOEnZb"><div class="h5"><br></div></div>
You&#39;re welcome.  I&#39;d look forward to seeing your rewrite, and whether it&#39;s really shorter and more straightforward.<br>
<br>
Another advantage is doing less disk I/O if you start by trying the requested directory directly, and only recursing to parents if you can&#39;t make the requested directory.<br>
<br>
I took a quick stab at it  (ask me later for mark.py)  and it wasn&#39;t as straightforward as I expected.  The main problem comes down to how to define the base case.  I think you might have the same problem also. You assume that you can safely go back to the mount point.  But if the path given is relative, you have to allow for that as well. Perhaps a call to os.path.abspath is in order.  I also think that ismount() might not be legal on Windows, if you care about that.<br>

<br>
Also, we have to worry about what happens when one of the directories cannot be made for reasons unrelated to the syntax of the string.  For example, the user might not have write permissions for one or more of the directories.  In fact, the user might not have read permissions either.<span class="HOEnZb"><font color="#888888"><br>

<br></font></span></blockquote><div><br></div><div>I am actually passing in the path already os.path.abspath-ed.  So, I should probably move that into the function for better encapsulation.  I am on Windows, so ismount is behaving correctly (I tested it in Idle before going with that as my base case).  Since this will end up being a throw-away, I will probably not worry too much about permissions and failures, but I can appreciate the need for such checks, should I decide to keep this for more widespread use.</div>
<div><br></div><div>Thanks again.  I will send my solution when I get a chance to get back to it (gotta get myself ahead in machine learning before the weekend gets too close :)</div><div><br></div><div>Mark</div></div>