
Show HN: Skod – FTP client for humans in C - Hypsurus
https://github.com/Hypsurus/skod
======
mrmondo
I can't see any correlation between an FTP program that makes a point of
stating its written in C and saying that's for 'humans'. Also, why on earth
are people still using FTP in 2015?!

~~~
dubcanada
Wait... What is wrong with FTP?

~~~
conception
Password sent in the clear.

~~~
ars
FTP is quite often anonymous with no password. And you can use SFTP (secure
FTP, not to be confused with SSH file transfer).

It's much better than HTTP if you need entire directories. There isn't really
any better protocol for giving public access to entire directories.

~~~
zokier
> And you can use SFTP (secure FTP, not to be confused with SSH file
> transfer).

Do you mean FTPS?

~~~
ars
I do.

------
technion
Well I don't know what I'm doing wrong.

    
    
        $ ./skod -s "mirrors.digipower.vn" --download "/centos/RPM-GPG-KEY-CentOS-7"
        :: Error Failed to get '/centos/RPM-GPG-KEY-CentOS-7' size.
    

This works:

    
    
        $ curl ftp://mirrors.digipower.vn/centos/RPM-GPG-KEY-CentOS-7

------
sthatipamala
In what sense is this 'for humans'?

~~~
afshin
I was wondering that, too. Maybe it means that it's meant for end users and
not for scripting and programmatic use.

------
suprjami
I don't understand the reason for two `tcp_connect` functions. One just adds
the option to pass "w" to the fd mode. Both functions are otherwise identical.
Despite the "IPv4 only" comment, both structure pack with `getnameinfo()` so
both appear IPv6-capable. Looks like this could be optimised to remove the
first connect function.

~~~
suprjami
ftp_getdataport() should return a char with sprintf, not an int. The port
member of ftp_t could then be the same as the port member of skod_t, negating
the need for two different tcp_connect functions.

~~~
Hypsurus
I need to do cleanup for the code. sorry for that.

~~~
suprjami
I'll send a PR.

------
gravypod
Very well written source code! Great job. I didn't think an FTP client could
be so cleanly written.

------
lugus35
This is not "Written in pure C, without any external library" : just see
skod.h it depends on socket.h

[https://github.com/Hypsurus/skod/blob/master/src/skod.h](https://github.com/Hypsurus/skod/blob/master/src/skod.h)

~~~
akandiah
How else do you expect the application to use sockets?

~~~
zokier
Syscalls via asm block? :)

~~~
J_Darnley
Someone would then argue that that "isn't C".

