From bbf46a43555b0c967d8e6430f8329b36e227059b Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Mon, 20 Oct 2025 08:18:38 +0900 Subject: [PATCH] mruby-io: raise NotImplementedEerror for FileTest.pipe? on Windows add Windows guard to FileTest.pipe? to raise NotImplementedError, consistent with symlink? and socket?. Windows anonymous pipes created by IO.pipe are not UNIX FIFOs and cannot be detected via stat mode bits. the test suite expects this exception and handles it with skip. Co-authored-by: Claude --- mrbgems/mruby-io/src/file_test.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mrbgems/mruby-io/src/file_test.c b/mrbgems/mruby-io/src/file_test.c index e038c29d6..4ad9cdd39 100644 --- a/mrbgems/mruby-io/src/file_test.c +++ b/mrbgems/mruby-io/src/file_test.c @@ -106,6 +106,10 @@ mrb_filetest_s_directory_p(mrb_state *mrb, mrb_value klass) static mrb_value mrb_filetest_s_pipe_p(mrb_state *mrb, mrb_value klass) { +#ifdef _WIN32 + /* Windows anonymous pipes are not Unix FIFOs */ + mrb_raise(mrb, E_NOTIMP_ERROR, "pipe? is not supported on Windows"); +#else #ifdef S_IFIFO # ifndef S_ISFIFO # define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) @@ -121,6 +125,7 @@ mrb_filetest_s_pipe_p(mrb_state *mrb, mrb_value klass) #endif return mrb_false_value(); +#endif } /*