Re: How to wait for file closing?

new topic     » goto parent     » topic index » view thread      » older message » newer message
ChrisB said...

The C++ program at the same time creates and deletes yumyum.lck whenever it opens and closes the file

That is how I would do it without having to worry about how the OS handles file locking and releasing.

There are probably better, and more sophisticated ways of doing it though.

Chris


You're correct. The biggest problem with using the OS to lock a file is if the app crashes, the file remains locked, and no one can use it until you manually unlock it.

The filesystem can be abused this way tho: any app that wants access to the file can write a filename-req-appname.txt file (or some other more imaginitive name), and then dir(filename-req-*.txt) will list the access queue for the file.

useless

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

Search



Quick Links

User menu

Not signed in.

Misc Menu