[ftputil] server_format / custom directory format parsing

Stefan Schwarzer sschwarzer at sschwarzer.net
Wed Jan 31 18:36:18 CET 2007


Hi Terrence,

On 2007-01-31 15:19, Terrence Brannon wrote:
> Per http://www.sschwarzer.net/python/ftputil.html#set-directory-format
> 
> I am wondering if the support for custom directory parsers is in
> place.

Yes, it should be in-place. What makes you think it's not? :)

> I am tackling the Connect:Enterprise UNIX FTP listing format:
> 
> ftp> dir
> 227 Entering Passive Mode (199,125,13,20,188,78)
> 150 Opening ASCII mode data connection for .
> -CR--M----FTP B kNLeX8       5286      231 Jan 31 08:12 compile-myself
> Total number of batches listed: 1
> 226 Transfer complete.
> ftp>

You can plug in your own parser class/instance as described in
the documentation. Note that you may (in your case, probably
will :-) ) be able to reuse some of the convenience methods of
the Parser base class. Let me know if any problems show up. If
possible, we should keep this subject on the list, so it may
end up as a reference for other people who need a custom parser.

Stefan


More information about the ftputil mailing list