python3 ftplib: check if dir exists via mlsd()
<p>I'm working with Python3 and ftplib.</p>

<p>I need to check if a directory on the ftp server exists. (if not, I can create it, than cwd into it, if it already exists i will directly cwd into it).</p>

<p>I've seen the method from Marek Marecki here: <a href="https://stackoverflow.com/questions/1098218/how-to-make-python-check-if-ftp-directory-exists">How to make Python check if ftp directory exists?</a></p>

<p><code>if 'foo' in [name for name, data in list(remote.mlsd())]:</code></p>

<p>Problem being this will also trigger on files named 'foo'.</p>

<p>Is there a Pythonic way doing this (explicitly with mlsd()) ? nlst() is deprecated</p>

<p>Thanks a lot!</p>