aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
Commit message (Collapse)AuthorAgeFilesLines
* * io.c (rb_io_initialize): add autoclose argument to control closenobu2010-03-211-1/+58
| | | | | | | | | at finalization. [ruby-core:26222] * io.c (rb_io_autoclose_p, rb_io_set_autoclose): new methods. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26999 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (IO_RBUF_CAPA_FOR): use large buffer as cbuf if readconv isnobu2010-03-211-18/+20
| | | | | | | | needed for performance improvement. based on a patch by Roger Pack in [ruby-core:28163]. [ruby-core:28162] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26997 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (IO_[CRW]BUF_CAPA_MIN): replaced magic numbers.nobu2010-03-211-6/+11
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26994 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_print): RDoc update. a patch from Daniel Kelleymatz2010-03-151-1/+3
| | | | | | in [ruby-core:28643]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26938 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_each_codepoint): read directly when readconv isnobu2010-03-141-3/+8
| | | | | | needed but internal encoding is not set. [ruby-core:28650] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26926 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_print): should not print field separator at the endmatz2010-03-131-2/+2
| | | | | | of arguments. [ruby-talk:358633] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26907 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c: Fix documentation for each/each_line/lines, bytes/each_byte,marcandre2010-03-071-70/+48
| | | | | | | | | | codepoints/each_code_point [ruby-core:23948] * string.c: ditto * ext/stringio/stringio.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26844 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_s_write, rb_io_s_binwrite): delete File#write andmame2010-03-061-145/+8
| | | | | | | | | | #binwrite. It may take a long time to make them stable, so 1.9.2 should not include them. We need refactoring to implement them again. * test/ruby/test_io.rb: delete tests for them. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26827 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_s_binwrite): use mode "r+b" instead of "ab" to handlemame2010-03-061-1/+1
| | | | | | | | offset correctly. [ruby-core:28517] * test/ruby/test_io.rb: use assert_equal instead of assert. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (pipe_open): suppressed a warning.nobu2010-03-051-1/+1
| | | | | | | | | * win32/win32.c (rb_w32_map_errno, winnt_stat, rb_chsize): ditto. * win32/win32.c (rb_w32_aspawn): get rid of overflow. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (io_s_write, io_s_binwrite): add File#write and #binwrite.mame2010-03-041-8/+145
| | | | | | | | [ruby-core:21701] * test/ruby/test_io.rb: add tests for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_lines, rb_io_bytes, rb_io_chars, rb_io_codepoints):mame2010-03-021-81/+57
| | | | | | | change to alias to each_*, in similar way to ARGF and String. [ruby-core:23948] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26797 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rdoc update.akr2010-02-191-2/+9
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26715 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (io_fread, io_getpartial, io_read, io_sysread): by using lock,mame2010-02-171-11/+7
| | | | | | | | | prohibit modification of buffer string during read (which had caused EFAULT or SEGV). [ruby-dev:40437] * test/ruby/test_io.rb: rewrite tests for the old behavior. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26704 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c: check lseek error by errno. NetBSD 4.0.1 may return -1 asakr2010-02-151-9/+13
| | | | | | | a file position of tty. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26674 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_oflags_modestr): return "r" for O_RDONLY|O_APPEND.akr2010-02-111-2/+5
| | | | | | | [ruby-dev:40379] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (READ_CHECK): do not select fd before reading, that had mademame2010-02-091-9/+11
| | | | | | TCPServer#gets stuck. [ruby-dev:40317] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_getline_fast): wrong calculation of new positionmatz2010-02-081-1/+1
| | | | | | | | | | from rb_str_coderange_scan_restartable(). [ruby-core:28103] * io.c (read_all): ditto. * sprintf.c (rb_str_format): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26622 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_each_codepoint): use cbuf when needs readconv.wanabe2010-01-311-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26529 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dln.c, file.c, io.c, signal.c: add __HAIKU__.naruse2010-01-251-4/+4
| | | | | | patched by Alexander von Gluck [ruby-core:27767] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_s_read): close the IO if an exception is raised onusa2010-01-081-2/+23
| | | | | | | seeking. [ruby-core:27429] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c (rb_iterate): pass current block when the argument bl_procmame2009-12-201-3/+3
| | | | | | | | | | | | is NULL. This behavior can be used to make enumerator faster [ruby-dev:39874] * enumerator.c (enumerator_each): pass current block directly instead of trampoline block (enumerator_each_i). * io.c (argf_each_line, argf_each_byte, argf_each_char): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * removed spaces just before tabs.nobu2009-11-261-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (read_all): fix: false negative invalid byte seequencenaruse2009-11-211-1/+1
| | | | | | | on reading from pipes. [ruby-dev:39743] fix: assigin the variable 'pos' as relative value from recent pos. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25880 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (MORE_CHAR_SUSPENDED): renamed from MORE_CHAR_CBUF_FULL.akr2009-11-181-5/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25847 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (fill_cbuf): extracted from more_char.akr2009-11-181-25/+41
| | | | | | | | | (io_shift_cbuf): fix memmove condition. (read_all): use fill_cbuf directly to avoid ECONV_AFTER_OUTPUT. [ruby-dev:39708] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25845 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_scan_open_args): move path encoding conversionnaruse2009-11-181-21/+0
| | | | | | | | | | | for filesystem encoding of Mac OS X. * file.c (file_path_convert): added for convert encoding of file path. * file.c (rb_get_path_check): add file_path_convert. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (parse_mode_enc): fix invalid access.akr2009-11-171-1/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25827 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (read_all): shift read buffer if exception occured.wanabe2009-11-161-1/+8
| | | | | | | pointed out in [ruby-dev:39702]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25795 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (read_all): don't call io_shift_cbuf until bufffering enough orwanabe2009-11-151-2/+7
| | | | | | | | | | | | econv_finished. [ruby-dev:39696] * io.c (more_char): don't call clear_readconv to read buffer after econv_finished. * io.c (appendline, rb_io_each_codepoint): clear readconv when done. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix typos.akr2009-11-031-6/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_to_ary): do not use #respond_to? to detectmatz2009-10-291-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to_ary. Just call. [ruby-core:23738] * eval.c (rb_check_funcall): new function with method existence check. returns Qundef when the method does not exist. * enumerator.c (enumerator_rewind): just call method, using rb_check_funcall(). [ruby-core:23738] * error.c (exc_equal): ditto. * object.c (convert_type): ditto. * error.c (rb_name_err_mesg_new): export function. * eval.c (make_exception): ditto. * io.c (pop_last_hash): return early when the last argument is nil. * io.c (rb_io_puts): treat T_STRING specially for small optimization. * vm_eval.c (raise_method_missing): skip method call if possible using rb_method_basic_definition_p(). * vm_eval.c (method_missing): ditto. * test/ruby/test_rubyoptions.rb (TestRubyOptions#test_debug): test suites changed to ignore exceptions caused by just-call policy. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25556 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (Init_IO): rb_default_rs should be US-ASCII.naruse2009-10-281-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (io_cntl): F_DUPFD is platform dependent.nobu2009-10-251-0/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (io_cntl): update max file descriptor by the result ofakr2009-10-231-0/+3
| | | | | | | fcntl(F_DUPFD). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25446 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (io_encoding_set): get rid of parsing non-ascii string, andnobu2009-10-151-4/+3
| | | | | | | refine messages for invalid name encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25350 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (io_reopen): unread current buffer before telling thenobu2009-10-151-7/+7
| | | | | | | position, for the case of reopening same file. [ruby-dev:39479] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25348 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rdoc update.akr2009-10-111-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25302 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (io_reopen): avoid close if possible.akr2009-10-061-8/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rdoc update.akr2009-10-051-4/+10
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_scan_open_args): rb_utf8mac_encoding is undefined.nobu2009-09-291-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_scan_open_args): add UTF8-MAC to no-convertion encoding.naruse2009-09-291-3/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25157 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/st.h (st_hash_func): use st_index_t.nobu2009-09-081-1/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_tell): adjustment for ungotten data.nobu2009-09-071-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (io_encname_bom_p): removed magic number.nobu2009-09-071-2/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (Init_IO): added rdocs for constants.nobu2009-09-071-8/+21
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24780 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c: fixed rdoc, a patch from Nobuhiro IMAI at [ruby-core:25433].nobu2009-09-061-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24767 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (argf_next_argv): fixed indent.nobu2009-09-051-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c: Add rdoc for ARGF.naruse2009-09-051-6/+643
| | | | | | contributed by Run Paint Run Run. [ruby-core:23854] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Rename FMODE_STRIP_BOM to FMODE_SETENC_BY_BOM.naruse2009-08-211-4/+4
| | | | | | | * include/ruby/io.h, io.c (FMODE_SETENC_BY_BOM): renamed from FMODE_STRIP_BOM. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24606 b2dd03c8-39d4-4d8f-98ff-823fe69b080e