Jump to content

View more

Image of the Day

Boxes as reward for our ranking mode. ヾ(☆▽☆)
#indiedev #gamedev #gameart #screenshotsaturday https://t.co/ALF1InmM7K
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

C# streamwriter.Write not printing entire string

4: Adsense

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   

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.

#2 Marineio   Members   

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   

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.