473,403 Members | 2,366 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

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 1567
"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
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
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
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
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
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
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
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
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
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
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.