How do you know some other user isn't viewing this file?
Because I am on a test server that only me can log on to.
My filemaker program is a system for sorting, classifying, merging pdf documents.
I use troi file plugin for doing so. Everything was working fine until I got the request to add a pdf preview on the layout.
The preview is done with the web viewer and I begun to have script stopping because file is in use...
But will this be the case when you are no longer simply testing?
You might be able to set up a loop that repeatedly tries to delete the file and terminates the loop when finished, but if another user has previewed the PDF and walks away from their computer with it still up, your loop may execute for a long time...
when the user will work on pdf files, I create copy of the files in a temp folder with his username.
That is how I prevent other users from working on them too.
I cannot really make a loop because if the person close the program before the loop ends, I will loose my syncro between filemaker info and the real physical files...
Sorry, but I don't see any other way, and am not sure if Troi gives you the necessary feed back to loop it in the first place.
You might try flagging the delete operation and then you can check for a pending "delete" when the file is closed and/or you can log an interrupted delete and try again the next time the file is opened by this user. (By then the delete will likely go through without a hitch.)
Just throwing out ideas here. Anyone have a better suggestion here?
Come to think of it, that might be a cleaner solution here:
- Log the file in a table with the info needed to delete it.
- Check the log, the next time the user opens the file and delete it then.