![]() |
|
|
|||||||
![]() |
Java - Writing to Files (I/O) Simple question. |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
Hey,
i have this code: String file = application.getRealPath("/") + "registered.txt"; FileWriter outW = new FileWriter(file, true); outW.write("*T --------------------- \n" // +"User ID: "+user_id+"\n" +"email: "+email+"\n" ); outw.close(); and it works fine. The only thing is i want it to overwrite whatever is previously written in registered.txt. i do not recall how to do this an couldn't figure it out int he documentation. if you can help me ill thank you in advance. -morc morc |
|
|
|
|
#2 |
|
Posts: n/a
|
On Wed, 2006-02-01 at 13:36 -0800, morc wrote:
> Hey, > i have this code: > > String file = application.getRealPath("/") + "registered.txt"; > FileWriter outW = new FileWriter(file, true); > outW.write("*T --------------------- \n" > // +"User ID: "+user_id+"\n" > +"email: "+email+"\n" > ); > outw.close(); Change line 2 to: FileWriter outW = new FileWriter(file, false); > and it works fine. The only thing is i want it to overwrite whatever is > previously written in registered.txt. > i do not recall how to do this an couldn't figure it out int he > documentation. > if you can help me ill thank you in advance. http://java.sun.com/j2se/1.5.0/docs/...g,%20boo lean) -- Asbjørn L. Johansen =?ISO-8859-1?Q?Asbj=F8rn?= L. Johansen |
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Convert Video files to PSP | ivan | DVD Video | 4 | 06-17-2008 11:16 AM |
| Simple region code question... simple answer?? | joseph.greer@gmail.com | DVD Video | 7 | 01-26-2007 09:07 PM |
| Convert Video files to MP4 for iPod | ivan | DVD Video | 0 | 04-26-2006 08:38 AM |
| Very slow recognising DVD disc | Terry Pinnell | DVD Video | 1 | 03-28-2006 06:53 PM |
| Now I introduce some popular software of multimedia | eightsome@gmail.com | DVD Video | 0 | 03-28-2006 02:29 PM |