Re: FTP client

Chris Angelico <[email protected]>
Newsgroups gmane.comp.lang.pike.user
Message-ID <CAPTjJmo=rJR=TenUViQqLyvw=oByORY4jP-9fe2ZuFJgOVfOYw@mail.gmail.com>
On Sat, Jan 17, 2015 at 12:31 AM, Pontus Östlund <[email protected]> wrote:
> Okey, I now have a simple FTP client that at least seems to be working
> somewhat. The only problem right now is that binary data seems to be
> scrambled in some way since binary files are broken when retrieved and
> written to local disk. Any ideas why?
>
> https://github.com/poppa/Pike-Modules/blob/master/Protocols.pmod/FTP.pmod
>

You're using gets(), which expects line-based results. Then you
concatenate them all, and in the process, lose the newlines.

I've sent you through a GitHub PR with a fix that appears to work on my system.

ChrisA
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.