Posted 18 years ago
by Boyd
-
Sr. Software Developer,
Patterson Consulting, LLC
I haven't tried this in SE 4.0, but it's consistent with SE 3.1 in the sample app. I have an application that is constantly writing to HTML formatted log files. I can open these files in Notepad, TextPad, WordPad, etc, without any problem. When I try to open the file using SE, I get an IOException.
Is there any way to get SE to properly read a file that is in use by another process?
FYI, this may be a symptom of the .NET Framework. I've tried a few different ways to open a text file in use by another process, and I can't get it to work. Any ideas?
[Modified at 10/11/2006 03:49 PM]
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.IO.IOException: The process cannot access the file "\\nadcwpappqcr01\QualityCenter\log\sa\SaServerLog_2006_10_11_01_28_33_999.html" because it is being used by another process.
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, Int32 bufferSize)
at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize)
at System.IO.StreamReader..ctor(String path)
at System.IO.File.OpenText(String path)
at ActiproSoftware.SyntaxEditor.Document.LoadFile(String path)
at TestApplication.MainForm.ExecuteAppAction(AppAction action) in C:\Program Files\Actipro Software\SyntaxEditor\v3.1.0210\TestApplication-CSharp.Net11\MainForm.cs:line 3617
at TestApplication.MainForm.toolBar_ButtonClick(Object sender, ToolBarButtonClickEventArgs e) in C:\Program Files\Actipro Software\SyntaxEditor\v3.1.0210\TestApplication-CSharp.Net11\MainForm.cs:line 2322
at System.Windows.Forms.ToolBar.OnButtonClick(ToolBarButtonClickEventArgs e)
at System.Windows.Forms.ToolBar.WmReflectCommand(Message& m)
at System.Windows.Forms.ToolBar.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
FYI, this may be a symptom of the .NET Framework. I've tried a few different ways to open a text file in use by another process, and I can't get it to work. Any ideas?
[Modified at 10/11/2006 03:49 PM]