I have an application which sits on a server in the network shared folder. Many users in network, can use that file simultaneously. I would like to perform an update of that EXE file and to do this, I would like to know who in network (besides me) is currently using that file.
Is it possible to check this programmatically? For example: to list all user names who are using that file now? Or atleast to retrieve number of locks on that file?
Thanks.
To list the open shared files in a machine you can use ADSI (Active Directory Service Interfaces).
In order to use these interfaces from delphi you must import the Active DS type library
Then access the
IADsFileServiceOperationsinterface, which contains a method calledResourcesthis method return a collection with all the shared resources opened.Check this sample code