PC Review


Reply
Thread Tools Rate Thread

Closing handle

 
 
=?Utf-8?B?UGV0ZXIgU2NobWl0eg==?=
Guest
Posts: n/a
 
      12th Apr 2005
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
 
Reply With Quote
 
 
 
 
William DePalo [MVP VC++]
Guest
Posts: n/a
 
      12th Apr 2005
"Peter Schmitz" <(E-Mail Removed)> wrote in message
news:544606A0-69ED-44EF-B609-(E-Mail Removed)...
> 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


 
Reply With Quote
 
Niray
Guest
Posts: n/a
 
      12th Apr 2005
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.

William DePalo [MVP VC++] wrote:
> "Peter Schmitz" <(E-Mail Removed)> wrote in

message
> news:544606A0-69ED-44EF-B609-(E-Mail Removed)...
> > 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


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fill handle turned into a move handle =?Utf-8?B?Tm9ydGh3b29kcw==?= Microsoft Excel Misc 1 2nd Mar 2007 03:40 PM
Handle the form closing when the user clicks on the "X" button (form caption bar) polocar Microsoft C# .NET 2 10th Nov 2006 04:03 PM
Possible to handle web requests without an ASPX page? i.e. have DLL handle request. jdlwright@shaw.ca Microsoft ASP .NET 2 31st May 2005 06:42 PM
Closing handle =?Utf-8?B?UGV0ZXIgU2NobWl0eg==?= Microsoft Dot NET 2 12th Apr 2005 05:44 PM
Handle form closing Etienne Charland Microsoft Dot NET Framework Forms 2 28th Sep 2004 09:29 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:45 AM.