This exemple show how to change the right on a file/directory ex : use case with SRM plugin : ./gfal_testdir srm://grid05.lal.in2p3.fr:8446/dpm/lal.in2p3.fr/home/dteam/test_obiwankenobi
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
main(int argc, char **argv)
{
int mode, error = 0;
char *file;
if (argc != 3) {
fprintf (stderr, "usage: %s file mode\n", argv[0]);
exit (1);
}
file = argv[1];
mode = strtol (argv[2], NULL, 8);
if (errno > 0) {
perror ("strtol");
exit (1);
}
printf ("Checking RW access to '%s'...\n",file);
error = 1;
}
printf ("Changing mode of '%s' to %o...\n", file, mode);
error = 1;
}
if (error) exit (1);
printf ("All is ok.\n");
exit (0);
}