file is open over the network - how can I tell which machine has it open? - Programmer
This is a discussion on file is open over the network - how can I tell which machine has it open? - Programmer ; Hi,
We have many machines which open files on our server. Occaissionally,
a given file is already opened (using fopen()) and when another user
tries to open it, the fopen() fails. What I would like to know is how
can ...
-
file is open over the network - how can I tell which machine has it open?
Hi,
We have many machines which open files on our server. Occaissionally,
a given file is already opened (using fopen()) and when another user
tries to open it, the fopen() fails. What I would like to know is how
can I find out what machine currently has the file open. The user
would be good as well but we all use the same user name. Is there a
Windows API function call that I can use?
Thanks,
Ted
-
Re: file is open over the network - how can I tell which machine has it open?
"Ted Sung" wrote in message
news:86dea8f5.0402190723.f221e4c@posting.google.co m...
> Hi,
>
> We have many machines which open files on our server. Occaissionally,
> a given file is already opened (using fopen()) and when another user
> tries to open it, the fopen() fails. What I would like to know is how
> can I find out what machine currently has the file open. The user
> would be good as well but we all use the same user name. Is there a
> Windows API function call that I can use?
Well.. that would be a combination of some of the Unicode only
functions with names starting with Net. Some useful ones could
be NetSessionEnum(), NetSessionGetInfo(), NetShare*(), etc.
Also check WNet* functions... 
- Sten
-
Re: file is open over the network - how can I tell which machine has it open?
That's what I thought but there is not info regarding the MACHINE name that's
returned from any of these functions.
"Sten Westerback" wrote in message news:<6r5%b.10330$g4.207342@news2.nokia.com>...
> "Ted Sung" wrote in message
> news:86dea8f5.0402190723.f221e4c@posting.google.co m...
> > Hi,
> >
> > We have many machines which open files on our server. Occaissionally,
> > a given file is already opened (using fopen()) and when another user
> > tries to open it, the fopen() fails. What I would like to know is how
> > can I find out what machine currently has the file open. The user
> > would be good as well but we all use the same user name. Is there a
> > Windows API function call that I can use?
>
> Well.. that would be a combination of some of the Unicode only
> functions with names starting with Net. Some useful ones could
> be NetSessionEnum(), NetSessionGetInfo(), NetShare*(), etc.
> Also check WNet* functions... 
>
> - Sten