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

File access issue

I am writing a program that opens a file and writes to it. When I open the
file to read data from it, I have no problems but when I try and write to it
I get an error saying that the file is already in use
(System.IO.IOException: The process cannot access the file
"O:\2006-04-25\2006-04-25.mpg" because it is being used by another
process.). As you can see the file is an mpeg file which are often very
large so I would rather not make a copy of the file to avoid the problem. I
used "Process Explorer" and found that Windows Explorer is locking my mpeg
files any time they are opened and will not release them unless the process
is killed and then started again. In Process Explorer there is an option to
close the handle which fixes the problem. Can anyone tell me how to add
this into my program so that if I run into this problem, I can simply close
the handle and try again? Thanks in advance for your help. -Jason
May 8 '06 #1
2 1029
Jason,

Have a look at this simple tip on our website

http://www.vb-tips.com/default.aspx?...9-d436c3b242c1

I hope this helps,

Cor

"Jason" <js******@comcast.net> schreef in bericht
news:Gp******************************@comcast.com. ..
I am writing a program that opens a file and writes to it. When I open the
file to read data from it, I have no problems but when I try and write to
it I get an error saying that the file is already in use
(System.IO.IOException: The process cannot access the file
"O:\2006-04-25\2006-04-25.mpg" because it is being used by another
process.). As you can see the file is an mpeg file which are often very
large so I would rather not make a copy of the file to avoid the problem.
I used "Process Explorer" and found that Windows Explorer is locking my
mpeg files any time they are opened and will not release them unless the
process is killed and then started again. In Process Explorer there is an
option to close the handle which fixes the problem. Can anyone tell me how
to add this into my program so that if I run into this problem, I can
simply close the handle and try again? Thanks in advance for your
lp. -Jason

May 8 '06 #2
Thanks for the reply but I am actually needing to write to the file as I am
patching the header. I need to open it with write access.
"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
Jason,

Have a look at this simple tip on our website

http://www.vb-tips.com/default.aspx?...9-d436c3b242c1

I hope this helps,

Cor

"Jason" <js******@comcast.net> schreef in bericht
news:Gp******************************@comcast.com. ..
I am writing a program that opens a file and writes to it. When I open
the file to read data from it, I have no problems but when I try and write
to it I get an error saying that the file is already in use
(System.IO.IOException: The process cannot access the file
"O:\2006-04-25\2006-04-25.mpg" because it is being used by another
process.). As you can see the file is an mpeg file which are often very
large so I would rather not make a copy of the file to avoid the problem.
I used "Process Explorer" and found that Windows Explorer is locking my
mpeg files any time they are opened and will not release them unless the
process is killed and then started again. In Process Explorer there is an
option to close the handle which fixes the problem. Can anyone tell me
how to add this into my program so that if I run into this problem, I can
simply close the handle and try again? Thanks in advance for your
. -Jason


May 8 '06 #3

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

Similar topics

18
by: Andre Laplume via AccessMonster.com | last post by:
I have inherited a bunch of dbs which are are shared among a small group in my dept. We typically use the dbs to write queries to extract data, usually dumping it into Excel. Most dbs originated...
4
by: Manu | last post by:
I want my user to upload a file to the site. Let us say a word file to be saved in the database for other users of the site to use. How can this be done? Is there a web control for that?
5
by: Jay Ge | last post by:
I searched this issue in internet, but they still cannot solve my issue, so your help/suggestion will be preciated. this page is placed on serverA, and it will touch files on serverB.(but it...
5
by: Daniel Corbett | last post by:
I am trying to save a file dynamically created in a webpage. I get the following headers, but cannot figure out how to save the attachment. I am basically trying to replicate what internet...
15
by: David Thielen | last post by:
Hi; My ASP.NET app (C# calling J# under .net 2.0) creates a png file in a subdirectory to display as part of the created page. However, the bitmap will not display due to a security violation. ...
17
by: Peter Duniho | last post by:
I searched using Google, on the web and in the newsgroups, and found nothing on this topic. Hopefully that means I just don't understand what I'm supposed to be doing here. :) The problem: ...
7
by: sprash | last post by:
Newbie question: I'm trying to determine if a file physically exists regardless of the permissions on it Using File.Exists() returns false if it physically exists but the process does not...
2
by: Arno R | last post by:
Hi all, I just heard from a sysadmin that there is an error message after installing my Acc97 RT app on a new server. Error message: "Can't open the file mfcans32.dll". Server: Windows Server2003...
0
by: Andy | last post by:
Thanks Peter, I thought I'd give an update on this problem. My application had 2 assemblies that contained classed for the Data access and business logic layer. It was on one of them that I was...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.