1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

2000-02-17

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@618 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2000-02-17 07:11:22 +00:00
parent 7dd3853eac
commit 96b40dff45
27 changed files with 286 additions and 171 deletions

10
io.c
View file

@ -1608,8 +1608,8 @@ rb_file_s_open(argc, argv, klass)
path = RSTRING(fname)->ptr;
if (FIXNUM_P(vmode)) {
int flags = FIX2INT(vmode);
int fmode = NIL_P(perm) ? 0666 : FIX2INT(perm);
int flags = NUM2INT(vmode);
int fmode = NIL_P(perm) ? 0666 : NUM2INT(perm);
file = rb_file_sysopen_internal(klass, path, flags, fmode);
}
@ -1649,7 +1649,7 @@ rb_f_open(argc, argv)
mode = "r";
}
else if (FIXNUM_P(pmode)) {
mode = rb_io_flags_mode(FIX2INT(pmode));
mode = rb_io_flags_mode(NUM2INT(pmode));
}
else {
int len;
@ -1661,6 +1661,7 @@ rb_f_open(argc, argv)
}
port = pipe_open(RSTRING(pname)->ptr+1, mode);
if (!rb_iterator_p()) return port;
if (NIL_P(port)) {
rb_yield(port);
}
@ -3396,4 +3397,7 @@ Init_IO()
#ifdef O_BINARY
rb_file_const("BINARY", INT2FIX(O_BINARY));
#endif
#ifdef O_SYNC
rb_file_const("BINARY", INT2FIX(O_SYNC));
#endif
}