This repository has been archived on 2022-02-10. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
mmk2410 35f7651c35 more secure combine function 2016-01-24 13:13:16 +01:00
.gitignore Advance gitignore including tests files and libssh src dir 2016-01-24 13:10:29 +01:00
LICENSE Initial commit 2015-08-13 14:59:59 +02:00
Makefile Initial commit 2015-08-13 14:59:59 +02:00
README.md Fix: Typo 2015-08-13 15:00:57 +02:00
dbg.h Initial commit 2015-08-13 14:59:59 +02:00
libssh.so Updated libssh.so to version 0.7.2 2016-01-24 13:11:18 +01:00
rangitaki-sync.c more secure combine function 2016-01-24 13:13:16 +01:00
rangitaki-sync.h Updated header and release info 2016-01-24 13:12:56 +01:00
rsl-download-test.c Updated header and release info 2016-01-24 13:12:56 +01:00
rsl-upload-test.c Updated header and release info 2016-01-24 13:12:56 +01:00

README.md

Rangitaki Sync Library

First of all: I'm really sorry for my bad code style, the bad design, all the ugliness , the missing comments (I will add them as soon as possible), for some things that may not work as expected, for every C developer who is used to read good code, for all the bugs that may happen. I'm sorry, but I'm not a good C developer. I just started coding in that language.

But, however, the funny part is: IT ACTUALLY WORKS! (or at least it should and did in my tests)

Anyway, this is a library written for synchronizing a Rangitaki blog with your device. (Actually you can download every directory recursive and upload single files...).

For testing purposes I wrote two test programs: One for uploading (single file), one for downloading (recursive, into /tmp).

These library is written on Linux and tested on Linux. It may works on other systems, but I don't know.

Even if I write all of my programs in the hope, that they will be useful for someone one day, I don't think that this will be used by anyone else than me. But look also in the 'Useful Stuff' section of this README.

Test programs

After running make you have following programs:

rsl-download-test

Just run it with ./rsl-download-test. You don't need to give any arguments, since it will ask you everything.

This program will download you all files and subdirectory of the entered remote directory into /tmp/rangitaki-sync. Normally the program should create this directory, if it isn't already there. If it fails to create it and it isn't already there, you will receive a nice and friendly error message...

rsl-upload-test

Just run it with ./rsl-upload-test. You don't need to give any arguments, since it will ask you everything.

This program will upload a single file form the entered path to the entered path on your server.

Credits

libssh project (libssh.org)

For there great ssh library and the awesome documentation.

Zed A. Shaw (zedshaw.com)

For his great book "Learn C the hard way".

For his awesome debug macros (The dbg.h file).

Useful Stuff

I wrote one function in this library which could be more useful for many people than the library: the char *getFilename(const char *input) function, which returns the filename of a path to a file.

E.g.

char *path = "/var/www/html/index.html";
printf("%s\n", getFilename(path)); // Will print 'index.html'