Re: FTP client

Pontus Östlund <[email protected]>
Newsgroups gmane.comp.lang.pike.user
Message-ID <CAAyMhKyG7SesMnVga3dN98Fkchptpt=sEDR8GDj6w-gndhnCZA@mail.gmail.com>
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

A simple use case:

int main(int argc, array(string) argv)
{
  Protocols.FTP.Client cli = Protocols.FTP.Client("graveyard");

  if (!cli->login("poppa", "some-password-dude")) {
    werror("Login failed!\n");
    return 1;
  }

  cli->binary_mode();

  cli->cwd("/Main");

  cli->retr("house.jpg", __DIR__);

  cli->quit();

  return 0;
}

# Pontus


2015-01-16 4:40 GMT+01:00 Chris Angelico <[email protected]>:

> On Fri, Jan 16, 2015 at 2:15 PM, H. William Welliver III
> <[email protected]> wrote:
> > Agreed… I’ll also add that I’d love to have an SSH/SFTP protocol module,
> but that’s not at all a one hour project :)
>
> Definitely! Pike does have a fairly awesome crypto module, though...
> how much of the existing SSL work can be reused? It would be rather
> awesome.
>
> 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.