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

Alan Bateman alanb at openjdk.org
Tue Oct 3 12:05:36 UTC 2023


On Tue, 3 Oct 2023 11:54:06 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:

>>> Can you replace this with #if defined(__linux) .. #else .. #endif as it will make it easier to read.
>> 
>> I'm not sure I follow. We need the `statx` code *and* the old `stat64` code on Linux as that's the fall-back code when `statx` isn't supported. We don't need the `statx` code on other platforms. If I used `#if defined(__linux__) ... #else ... #endif` instead, I wouldn't get the stat64 code on Linux without duplication. What am I missing?
>
> I've added indents. Not sure if it's any better.

>  What am I missing?

If you remove the "} else {" then it will be a lot simpler. The thing that I don't like is the `#if defined(__linux__) } #endif` at the end of each function, we shouldn't need that and the code will be a lot easier to read if the "} else {" is removed.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15792#discussion_r1343987930


More information about the nio-dev mailing list