Dealing with "file cannot be accessed.its already in use" error
Hi
I am working with log4net.Log files will be created each day and name of the file will be the current date.I want to display the contents of the file that i select in another page.
The problem is if i try to open a log of the present date error occurs.Message shown is that file cannot be accessed.Its used by another program.Plz help me to deal with this
Re: Dealing with "file cannot be accessed.its already in use" error
Who created those files?
I think the file is locked by other program, there is no way you can access it.
Re: Dealing with "file cannot be accessed.its already in use" error
U didnt get me.I am using log4net to create log files in my application.I can rename or delete the the log files which are not of present date.these log files r created based on date.when i access todays ie present date log file the error occurs
Re: Dealing with "file cannot be accessed.its already in use" error
Okay, as you are saying your application uses "log4net" thing, right ? So your application must have locked the log file for today, try closing it and then you can access it.
What is log4net anyway?
Re: Dealing with "file cannot be accessed.its already in use" error
Log4net is a dll file or a component used to create log files in a dot net applications.It can be downloaded.It came from log4j used in java.I think so
Re: Dealing with "file cannot be accessed.its already in use" error
It must be documented somewhere that log files are locked while they are logs are being written.