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

Jaikiran Pai jpai at openjdk.java.net
Thu Mar 25 08:05:51 UTC 2021


On Wed, 24 Mar 2021 23:45:16 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.

test/jdk/java/nio/file/Files/NullDevice.java line 34:

> 32:  * @run main NullDevice
> 33: */
> 34: public class NullDevice {

Hello Brian,

Given what's being tested here, perhaps this test should only be run against Windows OS? So maybe something like `@requires os.name=="windows"`?

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

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


More information about the nio-dev mailing list