|
| [WD21] Check if file is locked |
| Iniciado por guest, 20,jun. 2016 11:34 - 2 respuestas |
| |
| | | |
|
| |
| Publicado el 20,junio 2016 - 11:34 |
Hi All,
I am looking for a method to check whether a file (external file - jpg etc, not a HF file) is locked by another application.
Does anybody know a function that might be useful?
I have tried fLock and fOpen, but they only seem to work with txt files. Does anybody have any ideas?
Thanks Ned! |
| |
| |
| | | |
|
| | |
| |
| Publicado el 21,junio 2016 - 14:50 |
Hi Ned,
As far as I know there is no sure way in Windows to know if a file is being used by another application or not. This is why, Microsoft itself, and many other applications, use their own file lock mechanism (usually as MS Office does: an invisible file with the same name and a slight change to the file extension with a ~).
Note that fLock must also be used by the other application, otherwise it will not work. i.e. you will not know if it is locked. The other application must also keep the file open, which is a very rare case. Etc. There are many things to check...
Best regards, Alexandre Leclerc |
| |
| |
| | | |
|
| | |
| |
| Publicado el 22,junio 2016 - 15:08 |
Hi Alexandre,
Thanks for your insight.
I managed to workaround the locked file by copying it to another directory - I could then work with it as normal.
Thanks Ned! |
| |
| |
| | | |
|
| | | | |
| | |
|