PDA

View Full Version : Check file is in Use



sagirahmed
29th November 2010, 10:07
Hi,

Is there any method in Qt to identify that file is in use.

tbscope
29th November 2010, 10:45
Not in Qt.
Search the forum, this question has been asked before. There are a couple of techniques you can try like getting an exclusive lock on the file. If it works, you're the only one using it. If the exclusive lock fails, someone else already opened the file. But thats just a guess as I never tried this. And it might not work on all operating systems.

wysota
29th November 2010, 12:51
It will certainly not work on all operating systems. In Unix environment you need superuser privileges to know if a file is opened by some other process.