I hope you could help me, I'm trying to call in the date from another class and looks like "2011-03-09 06-57-40", I want to use this to create the file below but everytime I do when the output runs it creates a new file as it re-runs calling the dat(). I know what's going wrong I'm just not sure how to fix it, I want to permently writw to the same file. I hope this makes sense? :/
Thank you for any help in advance :)
date d = new date();
String cdate = d.date();
String f = h;
try{
PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(cdate + ".tsv", true)));
out.print(f);
out.print("");
out.close();
}catch (IOException e){
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…