What strikes me, however, is that the number of opened files increases by more than 2 for each invocation.. And especially that the number of opened files increases in a non-linear way.
Since you only open the file twice, this suggests that there is some other script in play here that does not clean up file handles properly.
There is more than one process opening and supposedly closing files but it doesnt appear to do so I have made sure that all the processes call the files by different names so as not to get them confused in any way but nothing I do seems to fix this problem
I have tried just the one process so as to be sure and still I end up with this problem.
Best advice I can give you right now, is to remove all scripts, and then load them one at a time until the issue returns. That, atleast, should tell you which script is at fault.
Next step would then be to add some putlog's whenever you open or close a file in a script, to keep track of which files are left opened, and where..