This question was closed as off topic but it is perfectly valid and on topic. The OP was not very clear and at first glance it might look like a programming issue (I imagine that is why it was closed) but it is not. It is simply about how one can find out which process is accessing a particular file on Linux. It has also been answered quite correctly (lsof
).
I can understand if the question was closed because it was cross-posted on U&L but in that case, it should be closed for the correct reasons and a comment explaining why cross posting is frowned upon added.