TCLUG Development Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [TCLUG-DEVEL:282] Java File I/O Question
I just happen to be working on a class involving file I/O. Here is what
I'm using for append mode:
String file = logFile;
FileWriter fWriter = new FileWriter(file, true); // append=true
fWriter.write(getCurrentTime() + " " + str + "\n");
Nishi
Perry Hoekstra wrote:
> Greet the sun all,
>
> I have a question concerning file I/O. If I have a file that exists, I
> do the following:
>
> File t_file = new File(file_exists_name);
> FileWriter t_fileWriter = new FileWriter(t_file);
>
> At this point, it empties my existing file rather than append. How do
> you get access to the file for append?
>
> I have not found any answer in either Java I/O or The Java Programming
> Language.
>
> --
> Perry Hoekstra
> Consultant
> Talent Software Solutions
> dutchman@mn.uswest.net
>