Click here to Skip to main content
15,893,622 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
How can i read a log file in run time without locking the file, while other processes are writting the same log file, using c#.net windows application.
Posted

1 solution

When I have these kinds of file/sharing/locking issues, I usually just make a copy of the file and open that one up instead. But depending upon what you are doing that might not work for you. What have you tried so far? I know that you can specify if you are opening a file for reading only...but I'm not sure if that would solve your locking problem. Have you tried File.OpenRead[^]? Or have you tried FileStream[^] with setting the mode/access/share parms to different settings to test it?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900