This example show how to list the files in a directory ex : use case with SRM plugin : ./gfal_testdir srm://grid05.lal.in2p3.fr:8446/dpm/lal.in2p3.fr/home/dteam/test_r2d2
#include <stdio.h>
#include <stdlib.h>
#include "gfal_posix_internal.h"
int main(int argc, char **argv)
{
struct dirent *d;
DIR *dir;
if (argc != 2) {
fprintf (stderr, "usage: %s filename\n", argv[0]);
return 1;
}
perror ("gfal_opendir");
fprintf(stderr, "%s\n", (*gfal_posix_get_last_error())->message);
return 1;
}
printf ("%s\n", d->d_name);
}
perror ("gfal_closedir");
return 1;
}
return 0;
}