Right management in a Root/C++ application under linux /conflict

One of our Pb with our application ILAIM based on Root /C++ under linux come from the fact that our program is interfaced with fortran executables in the following way :
A) copy of the input file with a mandatory name ( file.inp) in a directory common to all users
B) production by the FORTRAN program of several output file with mandatory name in a directory common to all users
Up to now, these files are produced by ILAIM with write right restricted to the first user using ILAIM leading to a conflict when another user n a directory common to all users use ILAIM afterward
· => a solution may consist in including using TSystem the chmod command:
: Is there a better solution
Thanks for advices
Thibaut

Hello,

Indeed you can use ROOT’s TSystem::Chmod to change the permissions, alternatively would it be possible to write the files with the right permissions in the first place?

Two simple Linux solutions:

  1. Assuming that all relevant users belong to some “ilaim_users” Linux group (any user will be able to delete / recreate files there):
chgrp ilaim_users /full/path/to/common/directory
chmod g+rwx /full/path/to/common/directory
  1. Assuming that the “ILAIM” executable is owned by some Linux “ilaim_user” (all files created by this executable will be owned by this user):
# chown ilaim_user /full/path/to/ILAIM
chmod u+s /full/path/to/ILAIM
chown ilaim_user /full/path/to/common/directory

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.