With clib:
clib install isty001/copy
..or
git clone https://github.com/isty001/copy
#include "copy.h"
Copy one file:
copy_file("./dir/file.txt", "./target_dir/file.txt");
Copy a directory recursively:
copy_dir("./dir/sub_dir", "./target_dir/sub_dir");
Both "./target_dir/file.txt"
and "./target_dir/sub_dir"
will be created if needed.