|
-
Jul 6th, 2001, 02:37 AM
#1
Thread Starter
New Member
File in use
Anybody any ideas to close a file which is used from another user with VB (like "net file ID /close function").
thanks for all information
jo
-
Jul 6th, 2001, 08:49 AM
#2
Assuming this is on a local machine:
If a different process has a file open, you can't close the file from your process. You have to get rid of the other process.
See this thread for various ideas on process termination.
If the file was left open by abnormal termination of the other process, then your only solution is to reboot. This is because the lock on the file remains in effect, even though the process is no longer there. If you use one of the methods in the above thread, no locks will remain after the process is gone.
The reason "net fileID close" works is because you're closing a file opened remotely on a server. Browser manager actually has the file lock, and responds to this function. Regular processes can't do that without extensive programming.
Maybe MS should implement a WM_LETGOTHATFILE message.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|