Re: File IO Error!!!

From: Jared Parsons [MSFT] (jaredpar_at_online.microsoft.com)
Date: 06/11/04


Date: Fri, 11 Jun 2004 10:09:55 -0700

This means that some process has this file opened already. Do you use this
file anywhere else in your process? If so, make sure that you close this
file when you are done with it.

Otherwise, go to www.sysinternals.com and download handle.exe. This will
allow you to see which process has that file open.

-- 
Jared Parson [MSFT]
jaredpar@online.microsoft.com
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Vai2000" <nospam@microsoft.com> wrote in message
news:eJaL#l8TEHA.808@tk2msftngp13.phx.gbl...
> Hi All, I am using File.Copy operation inside my program. I am running
into
> this error, any clues how to fix this?
> I am using this syntax for reading the file
> freader = new FileStream(this.fileName, FileMode.Open, FileAccess.Read,
> FileShare.ReadWrite);
> >>>>>>>>>
> The process cannot access the file "c:\temp\foo.txt" because it is being
> used by another process.
> Stack Trace:
>    at System.IO.__Error.WinIOError(Int32 errorCode, String str)
>    at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess
> access, FileShare share, Int32 bufferSize, Boolean useAsync, String
msgPath,
> Boolean bFromProxy)
>    at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess
> access, FileShare share)
> >>>>>>>>>
>
> TIA
>
>


Relevant Pages

  • Re: UnauthorizedAccessException: Cant write to file, but I can read i
    ... > FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath, Boolean ... > bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode, ... > FileAccess access, FileShare share) at System.Xml.XmlDocument.Save(String ...
    (microsoft.public.dotnet.framework.aspnet)
  • Receive Function Race Condition
    ... at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess ... access, FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath, ...
    (microsoft.public.biztalk.general)
  • FileReceive Function RACING!!!!
    ... at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess ... access, FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath, ...
    (microsoft.public.biztalk.general)
  • Why cant I access a file in Network driver from Windows Service?
    ... at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess ... access, FileShare share, Int32 bufferSize, Boolean useAsync, String ...
    (microsoft.public.dotnet.languages.csharp)
  • Why cant access a file under network drive from Windows Service?
    ... at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess ... access, FileShare share, Int32 bufferSize, Boolean useAsync, String ...
    (microsoft.public.dotnet.languages.csharp)