469,891 Members | 2,175 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,891 developers. It's quick & easy.

How to save re-vised stream back to file ?

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 !
Nov 15 '05 #1
1 1482
The stream does save my revised contents - my testing
error - this item should be deleated !
-----Original Message-----
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 !
.

Nov 15 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Sam Jost | last post: by
2 posts views Thread by bole2cant | last post: by
6 posts views Thread by Michael Groeger | last post: by
2 posts views Thread by Jim | last post: by
reply views Thread by amrhi | last post: by
1 post views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.