mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
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 <noreply@anthropic.com>
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user