I've run into a scenario which we have a script file dynamically created, saved to disk, then sent to InDesign Server to be executed. The code that tells InDesign Server to execute the script will delete that script file after it's finished executing. This works MOST of the time. However, sometimes, we get IO Execeptions stating that the file cannot be deleted because it is still in use. It would appear that InDesign Server is possibly holding onto the script files maybe even for just a millisecond after it's finished executing.
Has anyone experienced anything like this before? I'm looking for possible things to check (maybe it's not even ID Server that is the problem). Or maybe there is some option within ID Server when executing scripts that would allow ID Server to remove the file instead of our .NET code?
Any advice/suggestions greatly appreciated, thanks!
It appears that this problem is related to IDS executing the script. I've narrowed the problem down by taking the script execution completely out of the equation. If my code saves the script to disk and attempts to delete it right after - it works every time. I'm also able to, within our .NET code, save the script to disk, open the file up, read a line out, close it, and then immediately delete it. ONLY when ID Server executes that script between writing the file and deleting the file do we have problems.
Has anyone ever encountered anything like this? It seems to be directly related to ID Server holding onto the file for too long.
Again, many thanks in advance for any help!
Have the script delete itself.