Hi,
I was wondering if someone could help me. I am using java SWT and am trying to output a list of files and its properties to the screen. I have a file browser popping up and when i select a directory and click ok it outputs the path and list of files in that directory. However, i also want to output the type and created time of each file in that directory. i have an array that holds all the files but i am having trouble doing this. can anyone please help me.
Thanks in advanced,
scoobie
here is the code i am using:
DirectoryDialog dialog = new DirectoryDialog(shell);
dialog.setText("Browse For Folder");
dialog.setFilterPath("c:\\");
String res = dialog.open();
File path = new File(res);
File[] files;
files = path.listFiles();
int i;
int count = 1;
for(i = 0; i < files.length; i++)
{
File filename = files[i];
long size = filename.length()/1000;
System.out.println(count + " Filename: " + filename +
"\n" + "Size: " + size + " KB\n" +
"Path: " + path + "\n\n");
count++;
}
i++;