Re: How to wait for file closing?

new topic     » goto parent     » topic index » view thread      » older message » newer message


Multiprocessing can be a pain. Best effect is to use flag files. This way you can use more than one program language, any combination of OS, and many computers.

If App#1 wants to use FileB, see if Flag-FileB.txt has any data in it (or if Flag-FileB.txt exists), if not then write to Flag-FileB and close it. Now every App# who wants to use FileB can test Flag-FileB to see it is in use. When done with FileB, App#1 will clear Flag-FileB and close it (or delete it).

This trick should work anywhere, on any OS. There are more complicated and time-consuming ways to do this, which account for internet lag, you use time stamps and re-verifications, and in some cases several lock-files. I timestamp anyhow, to know when it was "locked" and who "locked" it.

useless

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu