This exemple show how to convert a surl to a turl ex : use case with SRM plugin : ./gfal_testget srm://grid05.lal.in2p3.fr:8446/dpm/lal.in2p3.fr/home/dteam/test_darkvador
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <errno.h>
#include <sys/param.h>
#define DEFPOLLINT 10
#define TURL_MAX_SIZE 1024
#ifndef _GFAL_1_X
int main(int argc,char **argv)
{
char turl_buff[TURL_MAX_SIZE];
if (argc < 2){
fprintf (stderr, "usage: %s SURLs\n", argv[0]);
exit (1);
}
ssize_t res =
gfal_getxattr(argv[1],
"user.replicas", turl_buff, TURL_MAX_SIZE );
if (res > 0)
printf("URL %s Ready - REPLICA: %s\n", argv[1], turl_buff);
else {
printf("URL %s Failed:\n", argv[1]);
}
return((res>0)?0:-1);
}
#endif