Skip to content
This repository has been archived by the owner on Oct 23, 2021. It is now read-only.

PhilipTrauner/dir_sync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dir_sync

A failed effort to write decent looking C++ code.
- Philip Trauner

Simple networked directory synchronization (please use something like rsync instead).

Limitations

  • Doesn't differentiate between case sensitive and case insensitive file-systems
  • No Windows support (lul)
  • Probably leaks memory like crazy
  • No input validation
  • If you poke it with a stick it will probably crash

Building

  1. Clone repository
git clone https://github.com/PhilipTrauner/dir_sync
cd dir_sync
  1. Install platform specific dependencies

    • Debian
    sudo apt-get install autoconf automake libtool curl make g++ unzip libssl-dev
    wget https://github.com/google/protobuf/releases/download/v3.5.1/protobuf-cpp-3.5.1.tar.gz
    tar xf protobuf-cpp-3.5.1.tar.gz
    cd protobuf-3.5.1
    ./configure
    make
    make check
    sudo make install
    sudo ldconfig
    
    cd ..
    • macOS
    brew install protobuf openssl cmake
  2. Install platform independent dependencies

mkdir cpp_clones
cd cpp_clones

git clone https://github.com/nlohmann/json.git --depth=1
git clone https://github.com/gabime/spdlog.git --depth=1
git clone https://github.com/chriskohlhoff/asio.git --depth=1
git clone https://github.com/muellan/clipp.git --depth=1
git clone https://github.com/fmtlib/fmt.git --depth=1
cd fmt
mkdir build
cd build
cmake .. && make

cd ../..

export JSON_INCLUDE_PATH=$(realpath json)/single_include/nlohmann
export FMT_PATH=$(realpath fmt)
export SPDLOG_INCLUDE_PATH=$(realpath spdlog)/include
export CLIPP_INCLUDE_PATH=$(realpath clipp)/include
export ASIO_INCLUDE_PATH=$(realpath asio)/asio/include
  1. Compiling
cd ..
mkdir build
cd build
cmake .. && make