Esempio n. 1
0
int chirp_matrix_delete(const char *host, const char *path, time_t stoptime)
{

	char *tmp;
	int nfiles;
	int i;
	int result;
	char *line;

	result = chirp_reli_getfile_buffer(host, path, &line, stoptime);
	if(result < 0)
		return -1;

	tmp = strtok(line, SEPCHARS);
	tmp = strtok(NULL, SEPCHARS);
	tmp = strtok(NULL, SEPCHARS);
	tmp = strtok(NULL, SEPCHARS);
	tmp = strtok(NULL, SEPCHARS);

	nfiles = atoi(tmp);

	for(i = 0; i < nfiles; i++) {
		char *dhost = strtok(NULL, SEPCHARS);
		char *dpath = strtok(NULL, SEPCHARS);
		char *s = strrchr(dpath, '/');
		if(s)
			*s = 0;
		chirp_reli_rmall(dhost, dpath, stoptime);
	}

	return chirp_reli_unlink(host, path, stoptime);
}
Esempio n. 2
0
INT64_T chirp_global_rmall(const char *host, const char *path, time_t stoptime)
{
	if(is_multi_path(host)) {
		errno = ENOSYS;
		return -1;
	} else if(not_empty(path)) {
		return chirp_reli_rmall(host, path, stoptime);
	} else if(not_empty(host)) {
		if(server_lookup(host, stoptime)) {
			errno = EACCES;
			return -1;
		} else {
			errno = ENOENT;
			return -1;
		}
	} else {
		errno = EACCES;
		return -1;
	}
}
Esempio n. 3
0
static INT64_T do_rm(int argc, char **argv)
{
	char full_path[CHIRP_PATH_MAX];
	complete_remote_path(argv[1], full_path);
	return chirp_reli_rmall(current_host, full_path, stoptime);
}