PDA

View Full Version : Detect locked files



Harvey West
12th December 2006, 15:09
Hello

I have a file(open by another 3rd party app on windows) which i would like to test for locked status. i.e. want to see if its being used.

Is there a QT command which can do this?

I was thinking of doing a rename to the file and see if it fails. Seems a bit messy and disruptive.

Cheers

e8johan
12th December 2006, 15:26
I'd just try to open it for writing - it aught to fail right there. As long as you open it in append mode you do not affect the contents of the file.

Harvey West
12th December 2006, 15:33
that worked, cheers.