View Single Post
  #1   Spotlight this post!  
Unread 19-01-2014, 17:47
blanketboyjo blanketboyjo is offline
Registered User
FRC #0687
 
Join Date: Jan 2014
Location: Southern California
Posts: 2
blanketboyjo is an unknown quantity at this point
File IO without overwriting file

Hi, so I am trying to make the CRIO print out to a text file that I can read through ftp. I have it working to make the file, but everytime the code runs it overwrites the file, is there any way to make it so that new lines are added to the existing file?
Code:
PrintStream writer;
DataOutputStream myFile;
FileConnection con;

try {
con = (FileConnection)Connector.open("file:///test.txt", Connector.WRITE);
con.create();
myFile = con.openDataOutputStream();
writer = new PrintStream(myFile);
} catch (Exception e) {
}
writer.println("Message");

Last edited by blanketboyjo : 19-01-2014 at 17:47. Reason: snipped code
Reply With Quote