RFR: 8316304: (fs) Add support for BasicFileAttributes.creationTime() for Linux

Alan Bateman alanb at openjdk.org
Tue Sep 19 15:03:42 UTC 2023


On Tue, 19 Sep 2023 14:45:33 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:

> The reason why I've chosen this one so far is two fold: a) What to do if `statx` is not available? (`glibc < 2.28` and/or `kernel < 4.11`) b) it seems much less risky that way, as we are only changing creationTime reporting. Everything else remains unchanged. Thus, a better fit for backports. a) seems a blocker for older systems, so we would need two separate implementations anyway?

The code to use both will be there but when you invoke a method to get the file attributes in bulk then it should get a consistent view with one syscall.  Backports are not a concern here.

> Incidentally, that's what my initial version was using and I've reconsidered going with this one instead since the complexity seemed not worth it. It would need to delegate to `UnixFileAttributes` anyway for older systems and the gist of the patch would be the native parts.

I think this should be explored, maybe along the lines of BsdFileSystemProvider override getFileAttributeView so that it has a more specific implementation of each of the attribute views.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/15792#issuecomment-1725819037


More information about the nio-dev mailing list