I have a c++ program that is split into pbs jobs and is then submitted to a computing cluster. I want the output of each job to be written to the same file; I have tried appending the file but this leads to abunch of nonsense since the same file gets opened by each job so not every job gets to write all of its output to the file. I was wondering if there is a way to check whether or not a file is open or closed in another program?
P.S. I checked if there were any helpful answers about similar question and there were not so I felt the need to ask this version