From: Robert Crandal on
In a networked environment, it is possible for multiple
users to open the same file simultaneously. I believe
that the first user to open the file is allowed to have
write access to the file, but anybody else who opens the
file same gets "read only" access.

Are there any API's I can use to enumerate through
all username's of users who have opened a particular
file? I am mostly interested in finding the username
who has write access to the file, but if I can enumerate
through all usernames who opened the file that would
be fine too.

Thank you!

From: m on

AFAIK the system provides no such API in general. But for your case look at
NetFileEnum + NetFileGetInfo in MSDN


"Robert Crandal" <nobody(a)gmail.com> wrote in message
news:k0Kln.38107$_v6.7205(a)newsfe08.iad...
> In a networked environment, it is possible for multiple
> users to open the same file simultaneously. I believe
> that the first user to open the file is allowed to have
> write access to the file, but anybody else who opens the
> file same gets "read only" access.
>
> Are there any API's I can use to enumerate through
> all username's of users who have opened a particular
> file? I am mostly interested in finding the username
> who has write access to the file, but if I can enumerate
> through all usernames who opened the file that would
> be fine too.
>
> Thank you!
>
From: Gerry Hickman on
Robert Crandal wrote:
> In a networked environment, it is possible for multiple
> users to open the same file simultaneously. I believe
> that the first user to open the file is allowed to have
> write access to the file, but anybody else who opens the
> file same gets "read only" access.

Isn't it the case that this is easier in a networked environment than on
a local machine? Assuming the files are on remote shares, you can view
"sessions", "shares" and "open files" in MMC when you connect to the
remote machine. This info is also available via WMI and probably Win API
too.

Now the hard (?) part:

How do you list all files that are open for writing on the local box,
and the process that holds the lock, using only MS documented API calls?

> Are there any API's I can use to enumerate through
> all username's of users who have opened a particular
> file? I am mostly interested in finding the username
> who has write access to the file, but if I can enumerate
> through all usernames who opened the file that would
> be fine too.
>
> Thank you!
>


--
Gerry Hickman (London UK)