Skip to main content

File creation date API

2 replies [Last post]
Joined: 2003-06-10

I have just discovered that there is no API to get the creation date of a file.

This is disappointing, not just because I have to learn and use JNI to have the informations I need but also because I will have to put a binary file (dll, so) in my distribution...

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2003-06-13

On top of that;
- get last-accessed date
- get/setCreationDate
- get/setModificationDate

Beware of multi-user; I'm not knowledgable about how Windows does this; but my first guess for cross-platform looks like this:
- get/setReadable(User user)
- get/setExecutable(User user)
- get/setOwner(User user)

All systems have something like a symlink. A *.lnk file on Windows or a file created with 'ln -s' on a Unix.
- is symbolic-link
seems appropriate; alternatively:
- getParentFile() # returning the parent of the current dir; this would ideally also work when you created the file without an absolute path..
- getAbsoluteParentFile() # returning the parent of the file pointed to by the symlink.

I know I had more, but I can't remember them right now..

Joined: 2003-06-10

JSR-203 is supposed to be addressing issues like this.

"Its major components will be:

1. A new filesystem interface that supports bulk access to file attributes, escape to filesystem-specific APIs, and a service-provider interface for pluggable filesystem implementations;"

setOwner is tricky in Windows. Normally an Administrator is allowed to take ownership, but can't set an arbitrary user as the owner. There is a backdoor method of giving ownership to another user via the backup api.