I have such a case - I'm working with FTP with help of ftplib
in Python.
I have a list of ftp pathes, that I need to check for existence. I was going to check it with ftp.cwd()
method + try\except
, - when exception is raised, folder doesn't exist. But pwd
of some folders, which don't exist in fact (I check it with my FtpZilla
) return 250 CWD command successful
and in ftp.nlst()
I get list of folder on one or more folders above.
According to FileZilla
and ftp.nlst("order\dvd\pictures")
there are only "games" folder.
But if I make ftp.cwd("order\dvd\pictures\cars\ferari\")
, It returns 250 CWD command successful
and ftp.nstl()
is equal to ftp.nlst("order\dvd\pictures")
.
Such case is not in every folder, - when trying to enter some non-existing folders, I get No such file or directory
which is right.
Maybe there are some "hidden" folders on ftp that cannot be found by neither FileZilla
, nor ftp.nslt()
, but can be reached by fpt.cwd()
?