Re: [ADVANCED-DOTNET] System.IO.Exception

2006-02-07 Thread Alex Smotritsky
: Sunday, February 05, 2006 11:00 AM To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM Subject: Re: [ADVANCED-DOTNET] System.IO.Exception If you are opening the file (using e.g. Notepad) while the logger does not have the file open, it's going to take an exclusive lock on the file (it assumes you will be wr

Re: [ADVANCED-DOTNET] System.IO.Exception

2006-02-05 Thread Peter van der Weerd
open and just write into it. Close the file when the process terminates. Peter - Original Message - From: "Alex Smotritsky" <[EMAIL PROTECTED]> To: Sent: Sunday, February 05, 2006 1:57 PM Subject: [ADVANCED-DOTNET] System.IO.Exception | I'm working on some code to

Re: [ADVANCED-DOTNET] System.IO.Exception

2006-02-05 Thread Eric Means
If you are opening the file (using e.g. Notepad) while the logger does not have the file open, it's going to take an exclusive lock on the file (it assumes you will be writing the file). Your file open will then fail as noted. What you need to do is one of two things: 1. On program startup, open

[ADVANCED-DOTNET] System.IO.Exception

2006-02-05 Thread Alex Smotritsky
I'm working on some code to do some asynchronous logging to a text file. If I open the file (manually) while it's being written to I get a System.IO.Exception with the message "The process cannot access the file (the path) because it is being used by another process. This happens consistently with