HFS on OS X supports the setting of the file creation time. Unfortunately, this is not implemented—only reading is, thanks to JDK-8011536. On OS X with HFS a call to set the creation time currently fails silently.
Even though the official manpage for OS X does not offer this piece of information (because it's from 1993!!!), it's implemented as described in the more up to date FreeBSD manpages. See for example https://www.freebsd.org/cgi/man.cgi?query=utimes&sektion=2 The important part being:
"For file systems that support file birth (creation) times (such as UFS2), the birth time will be set to the value of the second element if the second element is older than the currently set birth time."
The description implies, that the creation time can only be made older. Nevertheless, that's what one usually wants and is therefore useful.
Note, that the manpage also mentions other file system like UFS2, which also support birth dates. Perhaps a working implementation is worth having around for those file systems as well...
Even though the official manpage for OS X does not offer this piece of information (because it's from 1993!!!), it's implemented as described in the more up to date FreeBSD manpages. See for example https://www.freebsd.org/cgi/man.cgi?query=utimes&sektion=2 The important part being:
"For file systems that support file birth (creation) times (such as UFS2), the birth time will be set to the value of the second element if the second element is older than the currently set birth time."
The description implies, that the creation time can only be made older. Nevertheless, that's what one usually wants and is therefore useful.
Note, that the manpage also mentions other file system like UFS2, which also support birth dates. Perhaps a working implementation is worth having around for those file systems as well...
- duplicates
-
JDK-8151430 (fs) BasicFileAttributeView.setTimes should support setting file create time on OS X
-
- Resolved
-