By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,417 Members | 1,845 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,417 IT Pros & Developers. It's quick & easy.

How to save re-vised stream back to file ?

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.