copy.cpp 1.12 KiB
/**
 * @brief      Program that uses a binary and an output container to copy a directory in other.
 * 			   NOT RECURSIVE.
 * @author     Pablo Brox
 * @date       2020
 */
//#include <aws/core/Aws.h>
#include <iostream>
#include <dice.hpp>
int main(int argc, char **argv){
	//Aws::SDKOptions options;
   	//Aws::InitAPI(options);
	if(argc != 3){
		std::cout << "Wrong arguments.\n\t copydir directory_from directory_to\n";
		exit(-1);
	std::cout << "Copying files from " << argv[1] << " to " << argv[2] << "." << std::endl;
	std::cout << "Warning, all file extensions will be renamed to .out" << std::endl;
	//Create a binary container with the input directory
	//aspide::text_in_container in (argv[1]);
	aspide::binary_container in(argv[1]);
	//Create the output container to the destination directory
	aspide::output_container out(argv[2]);
	//Assign input to utput
	out << in;
	//Copy (by flushing containers)
	out.flush();
	//Aws::ShutdownAPI(options);
	//Print stats
	std::cout << "[INFO] Input container stats\n\n" << in.get_stats();
	std::cout << "\n\n[INFO] Output container stats\n\n" << out.get_stats();
	return 0;