470,647 Members | 1,155 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,647 developers. It's quick & easy.

Retrieve FTP directory with hidden files

Hello,
i know that this is not a python but a FTP protocol question but maybe
someone in this newsgroup could help me.

I use the standard ftplib.FTP class and get the listing wia
ftp.retrlines('LIST mydir')
but this does not get hidden files like ".htaccess" and more important
i can't delete directories because they are not empty.
Jul 18 '05 #1
1 2713
Lothar Scholz <du***@scriptolutions.com> wrote:
I use the standard ftplib.FTP class and get the listing wia
ftp.retrlines('LIST mydir')
but this does not get hidden files like ".htaccess"
This should work:

ftp.voidcmd("CWD mydir")
ftp.retrlines("LIST -a")

But of course you're at the mercy of the FTP server -- if
it insists on not returning "hidden" files to you, there's
nothing you can do about it.
and more important
i can't delete directories because they are not empty.


Correct. You have to delete the files in them first. The
FTP protocol (RFC959) does not specify recursive removal of
directories, as far as I remember.

Best regards
Oliver

--
Oliver Fromme, Konrad-Celtis-Str. 72, 81369 Munich, Germany

``All that we see or seem is just a dream within a dream.''
(E. A. Poe)
Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Didier FRAISSE | last post: by
3 posts views Thread by Stephen Green | last post: by
6 posts views Thread by Hemant Shah | last post: by
34 posts views Thread by kevin.watters | last post: by
6 posts views Thread by dkode8 | last post: by
12 posts views Thread by samoore33 | last post: by
2 posts views Thread by David C | last post: by
reply views Thread by warner | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.