got it. thanks. :)<br><br><br><div class="gmail_quote">On Sat, Feb 20, 2010 at 11:19 PM, MRAB <span dir="ltr"><<a href="mailto:python@mrabarnett.plus.com">python@mrabarnett.plus.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">Shashwat Anand wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
basically I infer that : dirname = path - basename, like for path = '//x', basename = x, hence dirname = '//'<br>
<br>
</blockquote></div>
[snip]<br>
Basically, os.path.dirname() should return the directory name, which<br>
means dropping everything after the last slash, and also the last slash.<br>
However, there's the special case where the name is in the root<br>
directory, and you want to retain the slash(es).<br>
<br>
When building a path (os.path.join()) you want to join the parts with a<br>
single slash between them, but there's the special case when a part is<br>
the root directory, and you don't want to add a slash between them, eg<br>
os.part.join('/x', 'y') should return '/x/y', but os.part.join('/', 'x')<br>
should return '/x'.<div><div></div><div class="h5"><br>
-- <br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</div></div></blockquote></div><br>