You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
743 B
28 lines
743 B
#include <stdio.h>
|
|
#include <libgen.h>
|
|
#include <string.h>
|
|
#include "ftree.h"
|
|
|
|
|
|
#ifndef PORT
|
|
#define PORT 30000
|
|
#endif
|
|
|
|
int main(int argc, char **argv) {
|
|
/* Note: In most cases, you'll want HOST to be localhost or 127.0.0.1, so
|
|
* you can test on your local machine.*/
|
|
if (argc != 3) {
|
|
printf("Usage:\n\trcopy_client SRC HOST\n");
|
|
printf("\t SRC - The file or directory to copy to the server\n");
|
|
printf("\t HOST - The hostname of the server\n");
|
|
return 1;
|
|
}
|
|
|
|
if (rcopy_client(argv[1], argv[2], PORT, basename(argv[1]), 0) != 0) {
|
|
printf("Errors encountered during copy\n");
|
|
return 1;
|
|
} else {
|
|
printf("Copy completed successfully\n");
|
|
return 0;
|
|
}
|
|
}
|
|
|