I do not see the behavior you described using OpenOffice on Windows.
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Date;
import java.util.Scanner;
public class CsvWriter {
public static void main(String args[]) throws IOException {
String fileName = "test.xls";
File file = new File(fileName);
PrintWriter out = new PrintWriter(new FileWriter(file));
out.println("a,b,c,d");
out.println("e,f,g,h");
out.println("i,j,k,l");
out.close();
System.out.println("Before: " + new Date(file.lastModified()));
System.in.read();
System.out.println("After: " + new Date(file.lastModified()));
}
}
exit:
Before: Mon Oct 05 10:01:27 CEST 2009
After: Mon Oct 05 10:01:27 CEST 2009
Maybe you can post a code showing how you do it? And on which platform do you run your application?
source
share