Hi there:
I am trying to write an app that identifies files in a specific directory over a week old, then deleting them.
However, I am even stuck on the first part - the File class.
Am I right that the following should return a list of all files in the directory "B2delete"?
public static void main(String[] args) {
File dir = new File("c:/B2delete");
String[] allfiles = dir.list();
System.out.println(allfiles);
If not, can anybody tell me where I am going wrong?
Thanks!
I am trying to write an app that identifies files in a specific directory over a week old, then deleting them.
However, I am even stuck on the first part - the File class.
Am I right that the following should return a list of all files in the directory "B2delete"?
public static void main(String[] args) {
File dir = new File("c:/B2delete");
String[] allfiles = dir.list();
System.out.println(allfiles);
If not, can anybody tell me where I am going wrong?
Thanks!