Hi is there a way of getting a file creation Date for a file class object?

I am trying to do so on a mac.

Many thanks

since there are certain OS' that do not "remember" the creation date of a file, I doubht Java has a standard sollution for this.
At least not one I've come accross to

No, at least not when using the standard library because in *nix, the creation time isn't stored anywhere. If you are running on a windows box, you have two options:
- spawn a shell process which fires the command 'dir /a' and extract the creation time [easiest]
- Use JNI, maybe something like FileTimes library

Many thanks for the replies.

I have tried this String creationDate = NativeInterface.nativeFileCreationDate(file.getAbsolutePath()); return creationDate; it then throws a : "java.lang.NoClassDefFoundError"

Is there any other means to do so on the mac or am I doing this wrong?

Many thanks again.

This question has already been answered. Start a new discussion instead.