Re: FTP client
Arne Goedeke <[email protected]>
| Newsgroups | gmane.comp.lang.pike.user |
|---|---|
| Message-ID | <[email protected]> |
On first glance it seems like you are using Stdio.FILE()->gets() to read
the file. FILE does charset conversion and gets() will also throw array
line endings, so that might be a reason for the corrupted data.
arne
On 01/16/15 14:31, Pontus Östlund 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
>
> 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
>>
>>
>