nobu
ce4e9dff9b
* io.c (io_fwrite): adjust stdio file position after direct write on
...
BSDish platforms. [ruby-core:26300]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@25485 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-26 03:06:29 +00:00
nobu
3f0d0b9398
* *.[chy]: removed trailing spaces.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@25430 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-22 01:00:18 +00:00
matz
4b986d7ff4
* io.c (rb_io_fptr_finalize): free fptr to avoid memory leaks.
...
fixed : #2009 [ruby-core:25173] [ruby-dev:39410]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@25181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-02 08:25:29 +00:00
nobu
d24f4c0fe3
* io.c (rb_io_binmode): check if closed regardless platforms.
...
[ruby-core:25363]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@24751 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-04 21:29:29 +00:00
usa
896285b4ea
* io.c (rb_sysopen): workaround for MSVCRT's bug.
...
[ruby-core:24838]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@24496 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-11 05:00:23 +00:00
nobu
27a9a7d1db
* io.c (argf_eof): go to the next file if called after ARGF.close
...
or ARGF.skip. [ruby-core:24561]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@24284 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-26 10:17:39 +00:00
nobu
b259db28fd
* io.c (Init_IO): $FILENAME should correspond to the first element
...
of ARGV initially.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@24283 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-26 09:42:28 +00:00
usa
72121b1681
* io.c (rb_io_flush): fsync() after buffer is flushed on win32.
...
backported from trunk. [ruby-core:20043]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@24223 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-21 10:40:47 +00:00
akr
c8eabecb9d
rdoc update.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@23824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-22 16:31:49 +00:00
nobu
47fc6a3ad0
* io.c (rb_io_open), math.c (domain_check), object.c (boot_defclass):
...
constified.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@23704 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-16 13:23:04 +00:00
matz
14d860d9ce
* io.c (argf_close): always call #close method. [ruby-core:23853]
...
* io.c (argf_skip): should close only when current_file is available.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@23700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-16 01:15:19 +00:00
knu
e8b0f17319
* array.c (ary_resize_capa): Remove an unused function.
...
* array.c, bignum.c, dir.c, enumerator.c, gc.c, io.c, numeric.c,
object.c, re.c, string.c, struct.c: Mixing two styles is not a
good thing. Stick with the K&R style in 1.8.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@23052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-23 12:07:23 +00:00
knu
f1f12658ee
* array.c (Array#try_convert): New method backported from 1.9.
...
* hash.c (Hash#try_convert): New method backported from 1.9.
* io.c (IO#try_convert): New method backported from 1.9.
* re.c (Regexp#try_convert): New method backported from 1.9.
* string.c (String#try_convert): New method backported from 1.9.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@23018 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-20 09:43:24 +00:00
akr
1babcafb03
update rdoc.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@22113 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-07 14:50:58 +00:00
akr
dc20aac2ce
add not about IO#pos and IO#readpartial.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@22110 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-07 12:04:31 +00:00
akr
ad98dd2c24
* io.c (io_getpartial): fflush after read for updating pos in FILE.
...
not portable, I guess. [ruby-core:21561]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@21913 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-31 07:07:21 +00:00
akr
127d914b2e
rdoc update.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@21048 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-25 16:15:00 +00:00
matz
98183a08c7
* dln.c: newer BeOS support. a patch from Pete Goodeve
...
<pete.goodeve at computer.org> in [ruby-core:18712].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@19424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-19 00:32:22 +00:00
nobu
d4c32f93e2
* file.c (rb_find_file): reset to real class.
...
* io.c (io_reopen): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@18378 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-05 20:10:16 +00:00
usa
c63b718fea
* io.c (rb_open_file, rb_io_s_sysopen): fmode should be unsigned int.
...
fixed [ruby-dev:34979]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16870 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-06 16:50:50 +00:00
nobu
4940cff399
* io.c (rscheck), marshal.c (w_nbyte, w_bytes, w_unique),
...
(path2class, path2module): constified.
* pack.c (pack_unpack), process.c (rb_syswait): suppress warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-01 20:28:01 +00:00
nobu
9ed3d64d1d
* suppress warnings on cygwin, mingw and mswin.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16740 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-01 19:55:25 +00:00
nobu
1378795e08
* suppress warnings with -Wwrite-string.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-31 09:28:20 +00:00
knu
e37b7b77a8
* ext/stringio/stringio.c (strio_each): Return an enumerator if no
...
block is given.
(strio_each_byte): Return an enumerator if no block is given,
and return self if one is given as the rdoc says.
* io.c (rb_io_each_byte): Fix rdoc. IO#each_byte returns self,
not nil.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16632 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-27 09:16:11 +00:00
knu
1906045a8f
* io.c (rb_io_each_char, argf_each_char, Init_IO):
...
Add {IO#,ARGF.}{each_char,chars}.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16629 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-27 06:39:47 +00:00
knu
30fe2b177c
* io.c (Init_IO): Define {IO,ARGF}#{getbyte,readbyte}.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16626 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-27 04:44:12 +00:00
knu
6b7869ae42
* io.c: (rb_io_lines, rb_io_bytes, Init_IO): Define
...
IO#{lines,bytes} and ARGF.{lines,bytes}.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16623 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-27 04:22:56 +00:00
nobu
722ad8f214
* eval.c (search_method, remove_method, error_print, rb_alias)
...
(rb_eval, rb_rescue2, search_required, Init_eval, rb_thread_create),
gc.c (rb_source_filename, Init_stack), io.c (rb_io_getline),
parse.y (rb_id2name, rb_parser_free): suppress warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16507 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-21 14:29:55 +00:00
nobu
9cee075559
* rubyio.h (rb_io_t): renamed from OpenFile.
...
* ruby.h (struct RHash), file.c, gc.c, io.c, ext/dl/dl.c,
ext/io/wait/wait.c, ext/pty/pty.c, ext/readline/readline.c,
ext/socket/socket.c: ditto.
* win32/win32.h: removed workaround for OpenFile.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16025 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-15 03:35:55 +00:00
knu
f5f1a18ceb
* enum.c (enum_find, enum_reject): Return an enumerator if no
...
block is given.
* io.c (rb_io_each_line, rb_io_each_byte, rb_io_s_foreach,
argf_each_line, argf_each_byte): Ditto.
* string.c (str_gsub): Ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16010 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-14 09:19:52 +00:00
matz
5074a2003f
* io.c (rb_open_file): should check NUL in path.
...
<http://www.rubyist.net/~matz/20080125.html#c01 >.
* io.c (rb_io_s_popen): ditto.
* io.c (rb_io_reopen): ditto.
* io.c (next_argv): ditto.
* io.c (rb_io_s_foreach): ditto.
* io.c (rb_io_s_readlines): ditto.
* io.c (rb_io_s_read): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@15287 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-28 03:33:05 +00:00
knu
a7b5cb96c6
* io.c (rb_io_mode_flags, rb_io_mode_modenum): Ignore encoding
...
options for forward compatibility.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@15154 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-21 08:43:58 +00:00
nobu
bf89a51315
* io.c (fptr_finalize): clear errno first. [ruby-talk:284492]
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@14858 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-03 02:29:04 +00:00
nobu
42cff90a29
* io.c (rb_io_tell, rb_io_seek): check errno too. [ruby-dev:32093]
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@13774 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-25 05:19:33 +00:00
nobu
233a94b91e
* error.c (rb_notimplement), io.c (pipe_open): removed definite
...
articles and UNIX manual section from messages. [ruby-dev:30690]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-04-04 15:42:16 +00:00
nobu
f67fc8a43f
* io.c (pipe_open): refined the message of NotImplementedError.
...
[ruby-dev:30685]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12146 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-04-04 08:08:46 +00:00
nobu
496371638e
* io.c (pipe_open): raise NotImplementedError for command "-" on
...
platforms where fork(2) is not available. [ruby-dev:30681]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-04-04 01:17:34 +00:00
nobu
d33cc535c3
* node.h (struct rb_thread.locals): explicit as struct.
...
[ruby-core:10585]
* eval.c, node.h (enum rb_thread_status, struct rb_thread,
rb_curr_thread, rb_main_thread): prefixed. [ruby-core:10586]
* file.c (chompdirsep): made an unprefixed name static.
* io.c (io_fread): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-24 14:40:08 +00:00
knu
438c4a6fdc
* io.c (rb_f_syscall): Fix buffer overflow with syscall
...
arguments. [ruby-bugs:PR#8541]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11711 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-13 06:21:47 +00:00
matz
43786b302e
* io.c (ruby_dup): start GC on ENOMEM as well.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-01-03 03:37:56 +00:00
matz
46fa18da5b
Revert r11453
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11454 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-01-03 03:14:57 +00:00
matz
4ee717dcae
* io.c (ruby_dup): start GC on ENOMEM as well.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-01-03 02:51:44 +00:00
matz
d9d3a1b2fb
* io.c (pipe_open): command name should not contain null bytes.
...
[ruby-dev:29421]
* process.c (proc_spawn): ditto.
* process.c (proc_spawn_n): ditto.
* process.c (rb_f_system): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10850 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-09-04 07:26:47 +00:00
matz
17c3d539f0
* ruby.h: use ifdef (or defined) for macro constants that may or
...
may not be defined to shut up gcc's -Wundef warnings.
[ruby-core:08447]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-31 06:34:10 +00:00
matz
6cd74eae6e
* io.c (io_close): always calls "close" method of the receiver.
...
[ruby-core:6911] [ruby-core:8112]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10636 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-28 16:27:42 +00:00
matz
e510c0e71f
* io.c (pipe_open): avoid closing uninitialized file descriptors.
...
a patch from <tommy at tmtm.org> [ruby-dev:28600]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-26 07:23:47 +00:00
akr
c4ab77fb3b
avoid useless fcntl in rb_io_set_nonblock.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10180 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-05-22 22:12:57 +00:00
akr
13ddc9fdd0
* rubyio.h (rb_io_set_nonblock): declared.
...
* io.c (rb_io_set_nonblock): new function.
(io_getpartial): nonblocking read support.
(io_read_nonblock): new method: IO#read_nonblock.
(io_write_nonblock): new method: IO#write_nonblock.
* ext/socket/socket.c
(sock_connect_nonblock): new method: Socket#connect_nonblock.
(sock_accept_nonblock): new method: Socket#accept_nonblock.
(sock_recvfrom_nonblock): new method: Socket#recvfrom_nonblock.
[ruby-core:7917]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10176 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-05-22 08:38:37 +00:00
akr
238cc5974b
update readpartial doc.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10149 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-05-13 07:43:41 +00:00
akr
4c4dd6ca31
note EAGAIN on readpartial document.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-05-09 02:12:11 +00:00