In Java
Create a file using any word processing program or text editor.

Write an application that displays the file's name, containing

folder size and time of last modification.
Save as FileStatistics
This is what I have with Attributes errors, what am I missing here ?
Thanks
<CODE>
import java.nio.file.*;
import java.nio.file.attribute.*;
import java.nio.file.attribute.Attributes;
import java.io.IOException;


public class FileStatistics
{
public static void main(String[] args)
{
Path filePath =
Paths.get("C:\\Java\\FileStatistics.txt");
try
{
BasicFileAttributes attr =
Attributes.readBasicFileAttributes(filePath);
System.out.println("Creation time " + attr.creationTime());
System.out.println("Last modified time " + attr.lastModifiedTime());
System.out.println("Size " + attr.size());
}
catch(IOException e)
{
System.out.println("IO Exception");
}
}
}
<CODE>

well, what does the stacktrace tells you?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.