Clear content of file while being used.

Is it possible to clear the content of a file while it is being used by a StreamWriter? If not, can I change StreamWriter to some other Stream and achieve this?

Edit: (Program Description)

I have a program that writes data into a file. And at the end of the day it should be cleared. However it is a separate program that is always running in the background, writing data. So the Stream will never be closed.

I have the source code of the program but I prefer not to include all of it into my code, so that I can stop the program. But if there is not other way, if would have to do that.

submitted by /u/illu11
[link] [comments]

Leave a Reply