Re: SLush and File Writing

Richard Southey <[email protected]>
Newsgroups gmane.comp.hardware.microcontrollers.tini
Message-ID <[email protected]>
Try flushing the stream before you close it, to make sure the string is 
actually written:

         writer.flush();

If the buffer is not filled up, it will not always be written to the 
file.  I've have had this problem on the PC many times, and it normally 
takes me ages to work out why.

Hope this helps,

Cheers

Richard

At 19:24 30/03/2004, Swami Venkataramani wrote:
>I wrote a program that writes a string to file (which already
>exists).  However, when I added this program as a Slush command and added this
>Slush command to the .startup file, it does not write to the file anymore. I
>tried using the DSFile class too, and still it doesn't work...
>
>Some sample code:
>
>DSFile dfile = new DSFile ("mode.txt");
>FileOutputStream dfileStream = new FileOutputStream (dfile);
>PrintWriter writer = new PrintWriter(dfileStream);
>writer.println(message);
>writer.close ();
>
>
>Any help is appreciated.
>
>Thanks,
>
>Swami.
>
>_______________________________________________
>TINI mailing list
>TINI-6tN4nzCoH/[email protected]
>To UNSUBSCRIBE, edit your profile, or see list archives:
>http://lists.dalsemi.com/mailman/listinfo/tini


_______________________________________________
TINI mailing list
TINI-6tN4nzCoH/[email protected]
To UNSUBSCRIBE, edit your profile, or see list archives:
http://lists.dalsemi.com/mailman/listinfo/tini
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.