How to save re-vised stream back to file ?

A

andrewcw

Missing the obvious here..thanks..
I need to open the file exclusively for on entry like this:
FileStream stream = null;
stream = File.Open(fiPath, FileMode.Open,
FileAccess.ReadWrite,FileShare.None);

// then I open the file stream
System.IO.StreamReader Tin = new System.IO.StreamReader
(stream);
long lpos =stream.Position;
string existText = Tin.ReadToEnd();
// and push some changes back into the stream.

BUT what causes the File then to save the stream ??
I have reread my stream and the changes are there.

THANKS !
 
A

andrewcw

The stream does save my revised contents - my testing
error - this item should be deleated !
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top