Is there any exception, if yes, send the stacktrace, if not, have you
checked the permissions? what about writer.close()?
I tested it, it worked with this:

        FileWriter fw = new FileWriter("test.txt", true);
        fw.write("test");
        fw.flush();
        fw.close();

about \n: I don't really know if there's a special method to do this job.
try it with

int index = theString.indexOf("\n");
theString = theString.substring(0, index);
(may be inefficient)

Christian

-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of sufi malak
Sent: Tuesday, February 12, 2002 6:25 PM
To: [EMAIL PROTECTED]
Subject: Re: FileWriter question


no, it does not work.
another question please how to get rid of an \n from a string before using
it in Writer.write(string);

>From: Christian Kurze <[EMAIL PROTECTED]>
>Reply-To: A mailing list about Java Server Pages specification and
>reference <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: Re: FileWriter question
>Date: Tue, 12 Feb 2002 18:00:58 +0100
>
>Hi,
>try it with
>writer.flush().
>Also check if you've got the permission to write the file.
>
>Christian
>
>-----Original Message-----
>From: A mailing list about Java Server Pages specification and reference
>[mailto:[EMAIL PROTECTED]]On Behalf Of sufi malak
>Sent: Tuesday, February 12, 2002 5:43 PM
>To: [EMAIL PROTECTED]
>Subject: FileWriter question
>
>
>Hi,
>I want to output some results to a text file using FileWriter :
>FileWriter writer = new FileWriter(fname, true);
>writer.write("string1");
>writer.write("\t"); // or writer.write(";");
>writer.write("string2");
>
>but it does not write tab or ";"
>
>thanks
>
>_________________________________________________________________
>Join the world’s largest e-mail service with MSN Hotmail.
>http://www.hotmail.com
>
>===========================================================================
>To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
>JSP-INTEREST".
>For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
>DIGEST".
>Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://archives.java.sun.com/jsp-interest.html
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.jsp
>  http://www.jguru.com/faq/index.jsp
>  http://www.jspinsider.com
>
>===========================================================================
>To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
>JSP-INTEREST".
>For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
>DIGEST".
>Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://archives.java.sun.com/jsp-interest.html
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.jsp
>  http://www.jguru.com/faq/index.jsp
>  http://www.jspinsider.com


_________________________________________________________________
MSN Photos is the easiest way to share and print your photos:
http://photos.msn.com/support/worldwide.aspx

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to