473,497 Members | 2,041 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Closing handle

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
Nov 22 '05 #1
2 1568
"Peter Schmitz" <Pe**********@discussions.microsoft.com> wrote in message
news:54**********************************@microsof t.com...
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
Nov 22 '05 #2
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" <Pe**********@discussions.microsoft.com> wrote in message news:54**********************************@microsof t.com...
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


Nov 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
345
by: Peter Schmitz | last post by:
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)....
6
3213
by: Gary Miller | last post by:
Does anyone know how to detect a modeless form on closing by the form that invoked the modeless form? form.Show();
4
7650
by: Jeff User | last post by:
Hi all I am using an OleDbDataReader. I need to establish and then keep the connection that I use, but I do not need to keep the data reader, after this operation is over. Therefore, regardless...
1
2229
by: Chirag Malvi | last post by:
hello all, I am developing the web application using ASP.net and VS.2003 IDE. here is the situation which i want to implement. 1) User is browsing some webform. I want to trap this event....
10
3980
by: Charles Law | last post by:
For some reason, when I click the X to close my MDI parent form, the action appears to be re-directed to one of the MDI child forms, and the parent remains open. I am then unable to close the...
10
1808
by: Ricky W. Hunt | last post by:
I have written a close routine to handle an "Exit" button to close the application properly. How do I make sure this gets executed if the user closes it another way (by pressing the "X" in the...
3
1333
by: Sumit | last post by:
HI.. I am having problem ot determine that a parent form is closing or not in my VB.Net code Any help Sumit
14
3332
by: =?Utf-8?B?UHVjY2E=?= | last post by:
Hi, I'm using VS2005 and .net 2.0. I'm creating an application that has 3 forms. I want allow users to move forward and backward with the forms and retain the data users have entered. I thought...
3
5245
by: Yang | last post by:
Hi, I'm experiencing a problem when trying to close the file descriptor for a socket, creating another socket, and then closing the file descriptor for that second socket. I can't tell if my issue...
19
3202
by: zacks | last post by:
I have a .NET 2.0 MDI application where the child form has a Tab Control. Each of the Tab in the Tab Control has a Validating event to handle what it should do when the user changes tabs. But...
0
7162
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7197
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6881
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
4899
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4584
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3088
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
650
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
287
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.