- Nov
- 76
- 1
Hi.
I have the following problem :
I have a BTM that opens a file for WRITE with %@FILEOPEN and somehting crashes in my program (not through debugging). Which means the file handle remains assigned and the file open.
It's therefore not possible to reopen the file with %@FILEOPEN until the handle on the file is released.
I can get the filename associated with a handle with %@FILEHANDLE, and even the program maintaining the lock with %@FILELOCK, but the reverse is not possible apparently. And there is no UNLOCK command, sadly.
(I have a program called 'Unlocker' that does this very thing, but I'd like to handle that specific condition from within my BTM)
So I need a trick to find out the handle number of the open file, and then close it so I can reopen it.
Perhaps some obscure attribute query, or even a WMIC query if all else fails...
PS:
==
I love TC, but I often find that variable functions only work one-way.
It would be nice if everything could be queried back and forth, as above.
Thanks.
M.
I have the following problem :
I have a BTM that opens a file for WRITE with %@FILEOPEN and somehting crashes in my program (not through debugging). Which means the file handle remains assigned and the file open.
It's therefore not possible to reopen the file with %@FILEOPEN until the handle on the file is released.
I can get the filename associated with a handle with %@FILEHANDLE, and even the program maintaining the lock with %@FILELOCK, but the reverse is not possible apparently. And there is no UNLOCK command, sadly.
(I have a program called 'Unlocker' that does this very thing, but I'd like to handle that specific condition from within my BTM)
So I need a trick to find out the handle number of the open file, and then close it so I can reopen it.
Perhaps some obscure attribute query, or even a WMIC query if all else fails...
PS:
==
I love TC, but I often find that variable functions only work one-way.
It would be nice if everything could be queried back and forth, as above.
Thanks.
M.