how to open a file?

Joined
Oct 31, 2007
Messages
3
Reaction score
0
I have a server which is always sending data, and I want to keep sending this data to a file. I tried using the following:



try{
file= FileOutputStream("modem.txt");
new PrintStream(file).println(new String(in));
file.close();
}
catch (IOException e){System.err.println("error");
System.exit(-1);}

But my data is always been overwritten, I want to keep the old and new data.

Is there any way to keep sending data into a file without overriding the old data?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,990
Messages
2,570,211
Members
46,796
Latest member
SteveBreed

Latest Threads

Top