Board index » Visual Studio » File Open and/or locked on Network- second request

File Open and/or locked on Network- second request

Visual Studio1
Is there a way to determine if a file is open and/or locked on another

computer on the network. If so is there a way to remotely close it?


-
 

Re:File Open and/or locked on Network- second request



<Jim@aol.com>wrote in message

Quote
Is there a way to determine if a file is open and/or locked on another

computer on the network. If so is there a way to remotely close it?



Depending on how it was open you can try to open it yourself for exclusive

reading and/or writing within error handler. In case of error you can make a

conclusion that the file was open with a corresponding lock (check for file

existence and permissions first).

I don't think you can close it if it is already open by some other process,

which you don't control.



Dmitriy.





-

Re:File Open and/or locked on Network- second request

<Jim@aol.com>wrote in message

Quote
Is there a way to determine if a file is open and/or locked on another

computer on the network. If so is there a way to remotely close it?



This seems to do what you want. I don't know how they do it. They usually

use undocumented API, services and drivers made on-the-fly to do these

things:



www.sysinternals.com/Utilities/PsFile.html">www.sysinternals.com/Utilities/PsFile.html





-

Re:File Open and/or locked on Network- second request

Not quite I want to know if a file is opened by another machine on

another machine on a peer-to-peer network

On Fri, 7 Jul 2006 18:21:55 -0400, "expvb" <nobody@cox.net>wrote:



Quote
<Jim@aol.com>wrote in message

news:fkkta219snhllu2qdpctbfjjj2ub4bjb0s@4ax.com...

>Is there a way to determine if a file is open and/or locked on another

>computer on the network. If so is there a way to remotely close it?



This seems to do what you want. I don't know how they do it. They usually

use undocumented API, services and drivers made on-the-fly to do these

things:



www.sysinternals.com/Utilities/PsFile.html">www.sysinternals.com/Utilities/PsFile.html





-