ftputil version: 2.2.2
ftpserver: any, (i used proftpd on localhost)
OS: Linux julian-laptop 2.6.20-16-generic #2 SMP Thu Jun 7 20:19:32 UTC 2007 i686 GNU/Linux
Currently hidden files on the remote host are not listed. it would be nice if (maybe as an option to be set by a flag) the ftp DIR command could be called with "-a [path]" instead of "[path]" as an argument.
Currently i have a work around by changing ftputil.py, line 748 from
ftp_error._try_with_oserror(self._session.dir, path, callback)
ftp_error._try_with_oserror(self._session.dir, '-a '+path, callback)
I'm not sure how generic this options works across servers with different OS's though.
This topic has has been brought up on the mailing list, and because of the problems mentioned there, I tend to refrain from adding the requested support for hidden files.
I set the resolution to "wontfix" but that's not necessarily my final word, but for now, it is. ;-)
I have implemented auto-probing of
-aoption as of changeset ac808dc5d241b02249e86e632b933e8489cdfabe.
Note a few caveats:
All servers I tried seem to ignore
LISToptions they don't know. So if ftputil finds the option is accepted, that doesn't mean that it'll have any effect.
In theory the server might consider the option, but do something different with it than displaying hidden entries.
Even if the server software supports the
-aoption, the server might be configured to ignore it.
There may be rare programs which rely on "hidden" entries not being displayed. In that case, please change your code. As a crude workaround, you can use
ftp_host._accepts_list_a_option = Falseright after the login. However, this may stop working some day, so you should really adapt your code.
There's an anomaly with directory entries which start with a hyphen. For example, if you try to list a line for a file named "-a", the server will interpret "LIST -a" or even "LIST -a -a" as a
LISTfor the whole directory. The entry "-a" will be displayed though. However, this shouldn't have any effect if you only use ftputil's official API.