Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Show HN: Skod – FTP client for humans in C (github.com/hypsurus)
39 points by Hypsurus on Oct 11, 2015 | hide | past | favorite | 27 comments


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?!


>Also, why on earth are people still using FTP in 2015?!

Why are people still using the command line in 2015? Why do we still use HTTP? Because as with FTP, there are use cases for which it still works perfectly well.


Why not? I know FTP is not secure, and when I wrote skod I discovered lots of weaknesses in FTP. but still people using it.


Wait... What is wrong with FTP?


Password sent in the clear.


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.


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

Do you mean FTPS?


I do.


FTP-over-TLS has been around for a long time, and is widely supported by clients and servers.

But it's a really nasty hack, that introduces a lot of other issues.


You mean FTP/S aka RFC4217? You ain't kidding about being a nasty hack. When it recently came up in my world, the only place it seemed to be really well supported was in the AS/400 world, where IBM seems to have standardized on it. Everywhere else there seemed to be any number of weirdnesses, incompatibilities and decrepit features. YMMV.


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


In what sense is this 'for humans'?


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


The source code is very well-written from a readability perspective, and the commmand-line API looks well-designed too.


Submit a pull request saying that membership of Homo Sapiens is a requirement of use.


easy to use? clean code? it's not complex.


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.


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.


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


I'll send a PR.


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


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


How else do you expect the application to use sockets?


Sockets are not part of ANSI C, as such they are an external library.


Syscalls via asm block? :)


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


My intention was that the user will not need to install an external library.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: