RFR: 8263898: (fs) Files.newOutputStream on the "NUL" special device throws FileSystemException: "nul: Incorrect function" (win) [v5]

Alan Bateman alanb at openjdk.java.net
Sat Mar 27 15:57:26 UTC 2021


On Fri, 26 Mar 2021 22:06:43 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> This request proposes to change the native method `WindowsNativeDispatcher.SetEndOfFile()` to succeed even if the Windows function `SetEndOfFile()` returns zero if `GetFileSizeEx()` called on the handle succeeds and reveals a file size of zero.
>
> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8263898: Fix accidentally reverted copyright year

The change looks okay.

The test looks okay although there other cases that probably should be added at some point, in particular, FileChannel.open for reading, and AsynchronousFileChannel read & write.

test/jdk/java/nio/file/Files/NulDevice.java line 41:

> 39: public class NulDevice {
> 40:     public static void main(final String[] args) throws IOException {
> 41:         System.getProperties().list(System.out);

Is the printing of the system properties a left-over?

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

Marked as reviewed by alanb (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/3183


More information about the nio-dev mailing list