Advertisement Jump to content
Sign in to follow this  

C# streamwriter.Write not printing entire string

This topic is 3965 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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);


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.

Share this post

Link to post
Share on other sites
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?

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!