Beispiel #1
0
INT64_T chirp_global_thirdput(const char *host, const char *path, const char *thirdhost, const char *thirdpath, time_t stoptime)
{
	if(is_multi_path(host)) {
		errno = EACCES;
		return -1;
	} else if(not_empty(host)) {
		return chirp_reli_thirdput(host, path, thirdhost, thirdpath, stoptime);
	} else {
		errno = EACCES;
		return -1;
	}
}
Beispiel #2
0
static INT64_T do_thirdput(int argc, char **argv)
{
	INT64_T result;
	char full_path[CHIRP_PATH_MAX];
	char remote_path[CHIRP_PATH_MAX];
	time_t stop, start;

	complete_remote_path(argv[1], full_path);
	sprintf(remote_path, "/%s", argv[3]);


	start = time(0);
	result = chirp_reli_thirdput(current_host, full_path, argv[2], remote_path, stoptime);
	stop = time(0);
	if(stop == start)
		stop++;

	if(result > 0) {
		printf("%" PRId64 " bytes transferred in %d seconds ", result, (int) (stop - start));
		printf("(%.1lfMB/s)\n", result / (double) (stop - start) / 1024.0 / 1024.0);
	}

	return result;
}