如何使用 TrueVFS 设置文件的最后修改日期?因为根据(手册)它应该像
File entry = new TFile("archive.zip/dir/HälloWörld.txt");
entry.setLastModified(System.currentTimeMillis());
但这对文件不起作用,但如果我对文件夹做同样的事情,它会起作用。
这就是我正在使用的
String NUMBER_FILE = "C:/333/ServerEAR.ear/1.txt";
String newLastModified = "11/12/1999 14:15:16";
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
long newDate = sdf.parse(newLastModified).getTime();
File entry = new TFile(NUMBER_FILE);
boolean result = entry.setLastModified(newDate);
虽然结果为真,但日期并未修改为我想要的日期