File creation time in OSX with Java 7

I need to get the file creation time attribute in OS X Lion. I tried with Java nio , but instead returns the modification time:

BasicFileAttributes attr = Files.readAttributes(path, BasicFileAttributes.class);     
System.out.println("Creation time: " + attr.creationTime());

I read similar questions ( Determine when a file was created in Java ) and I know that some file systems do not support file creation timestamps, but HFSP does , so the BasicFileAttributes.creationTime method should not return the correct value on OS X?

+5
source share
1 answer

Not sure why, but do you see the same timestamp for all of these:

System.out.println("creationTime: " + attr.creationTime());
System.out.println("lastAccessTime: " + attr.lastAccessTime());
System.out.println("lastModifiedTime: " + attr.lastModifiedTime());
0
source

All Articles