Jump to content

  • Log In with Google      Sign In   
  • Create Account


C# streamwriter.Write not printing entire string


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Chaotic_Attractor   Members   -  Reputation: 152

Like
0Likes
Like

Posted 15 March 2008 - 10:30 AM

I am trying to write the output of a disassembled shader to a file.
Effect effect = Effect.FromFile(device, filename, null, null, ShaderFlags.None, null);
string text = effect.Disassemble(false);

stream.WriteLine(text);

I have checked the string "text" in the editor and it is complete, but when it is written to the file, the last few lines seem to be cut off. I have tried splitting the string and writing each of the split strings to the file, but that doesn't seem to help.

Sponsor:

#2 Marineio   Members   -  Reputation: 134

Like
0Likes
Like

Posted 15 March 2008 - 11:52 AM

Are you .Flush() 'ing your stream after you write it?

#3 Chaotic_Attractor   Members   -  Reputation: 152

Like
0Likes
Like

Posted 15 March 2008 - 12:00 PM

That did it. Thanks.

I was flushing beforehand. When I tried split the larger string into substrings, I flushed between strings, but not after the last one.

I tried converting the string into a character array and told it to output the number of characters in the array. Especially in this case, why would there be data still left in the output buffer?




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS