Closing handle

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I've got the following problem: My current project consists of several
clients and all of them use(read) a file, that is placed on a shared hard
disk on one of my file servers (windows2k). So, every user that is logged on
a computer the client software runs on needs access (exclusive) to this file.
Now, the problem is, that sometimes the users leave the file in an open
state - and do not close their handle - so no other client can access the
file any longer.
That's why I'm looking for a way to close all handles (even of remote
clients) to a specific file "by violance". Is this possible?

Thanks
Peter
 
Peter Schmitz said:
I've got the following problem: My current project consists of several
clients and all of them use(read) a file, that is placed on a shared hard
disk on one of my file servers (windows2k). So, every user that is logged
on
a computer the client software runs on needs access (exclusive) to this
file.
Now, the problem is, that sometimes the users leave the file in an open
state - and do not close their handle - so no other client can access the
file any longer.
That's why I'm looking for a way to close all handles (even of remote
clients) to a specific file "by violance". Is this possible?

How will you ever be able to distinguish the case where a client validly
maintains a handle to a file for an extended period from one which breaks
your rules (unspoken here) ?

Some advice FWIW:

1) When the operating system appears to get in the way (here by protecting
handles), think harder about the design
2) Rather than require the clients to have exclusive access to a file,
centralize the file updates and have the clients make requests of the common
updater

Regards,
Will
 
Peter, I have had the same problem accessing the file, but i didn't
have exclusive user rights to the directory. We had the directory
permissions set for ASP Net Account. It worked for me on closing the
file handle and any related objects in the finally block.
 
Back
Top