473,386 Members | 1,647 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,386 software developers and data experts.

Checking Resource Status of a File

Is there anyway in VB.NET to test a file to see if another resource is
currently using it? Basically, through an automated process, a file is
opened (and then closed with user intervention); however, I need to be
able to carry on a process after that fact, so I'd like to poll the
file until the resource has been given up. Any advice would be greatly
appreciated.
Thank You,
Jason E. Trout
js*******@cox-internet.com
Nov 20 '05 #1
2 853
* ja***@accesseforms.com (Jason E. Trout) scripsit:
Is there anyway in VB.NET to test a file to see if another resource is
currently using it? Basically, through an automated process, a file is
opened (and then closed with user intervention); however, I need to be
able to carry on a process after that fact, so I'd like to poll the
file until the resource has been given up.


The only way to do that I am aware of is to try to open the file for
shared reading and catch an exception if the file cannot be opened in
this mode.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #2
Hi Jason,

In addition to Herfried,

When it is an Access file than do not what is everywhere told (as well by
me) for a database and to close it every time after you did a dataadapter
fill or dataadapter update. Keep it open all the time, the same you should
do in situations for other files in my opinion which are not freeed to use
by other users.

I hope this helps?

Cor
Is there anyway in VB.NET to test a file to see if another resource is
currently using it? Basically, through an automated process, a file is
opened (and then closed with user intervention); however, I need to be
able to carry on a process after that fact, so I'd like to poll the
file until the resource has been given up. Any advice would be greatly
appreciated.

Nov 20 '05 #3

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

Similar topics

2
by: Marc S. Gibian | last post by:
I am putting together a Perl tool to manage a large set of tasks related to building a rather complex set of software. One of the goals for moving to Perl is to provide very rigorous error checking...
1
by: Rob Meade | last post by:
Hi all, Ok - minor problem - looking for work-a-rounds... I want to offer on our organisations intranet a support site for our webmasters, one of the features I'd like to add is a server...
1
by: Jake | last post by:
I have a deadlock situation, part of the problem looks like this; spid ecid dbid ObjId IndId Type Resource Mode Status ------ ------ ------ ----------- ------ ----...
8
by: gremlinbass | last post by:
I was wondering if I can check to see if a file is open? Specifically, is there any way I can code Access to check to see if a text file (datasource.txt to be specific) is open, returning a true...
1
by: MSDN Account | last post by:
We have web site that used the IIS ResKit tool MSWC.PermissionChecker to check file permissions. The web site has been upgraded and that upgrade included changing the default server side language...
7
by: Hulo | last post by:
In a C program I am required to enter three numbers (integers) e.g. 256 7 5 on execution of the program. C:\> 256 7 5 There should be spaces between the three numbers and on pressing "enter",...
0
by: klemen.verdnik | last post by:
Hi... I'm having some difficulties getting all possible keys from a specific resource class. Let's say I have a file named: MyProj.TranslationStrings.resx in my App_GlobalResources folder ...
0
by: sudosue | last post by:
I have a systems analyst who came to me with a problem with retrieving a PDF file from a clients website. I've reduced the explaination to the bare facts thus if you need more information just let...
13
by: Bob Jones | last post by:
Here is my situation: I have an aspx file stored in a resource file. All of the C# code is written inline via <script runat="server"tags. Let's call this page B. I also have page A that contains...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
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,...

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.