summaryrefslogtreecommitdiffstats
path: root/io.c
Commit message (Collapse)AuthorAgeFilesLines
* * io.c (io_encoding_set): ignore second argument when external andnaruse2009-02-091-0/+4
| | | | | | internal are same. [ruby-dev:37939] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22146 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_s_binread): ensures file path. [ruby-dev:37940]nobu2009-02-081-0/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22121 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (io_fread): use rb_io_wait_readable for retryakr2009-02-061-0/+3
| | | | | | | avoid Errno::EINTR on ruby -e 'trap(:CHLD) {}; spawn("sleep 1"); STDIN.read' git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22099 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* (pipe_open) [__SYMBIAN32__]: fixed compile time error azav2009-02-061-0/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22096 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/intern.h (rb_run_exec_options_err): renamed fromakr2009-02-051-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rb_run_exec_options. (rb_exec_err): renamed from rb_exec. (rb_fork_err): renamed from rb_fork. (rb_spawn_err): renamed from rb_spawn. (rb_run_exec_options): declared with 1.9.1 compatible signature. (rb_exec): ditto. (rb_fork): ditto. (rb_spawn): ditto. * process.c (rb_run_exec_options_err): renamed from rb_run_exec_options. (rb_exec_err): renamed from rb_exec. (rb_fork_err): renamed from rb_fork. (rb_spawn_err): renamed from rb_spawn. (rb_run_exec_options): defined. (rb_exec): ditto. (rb_fork): ditto. (rb_spawn): ditto. * io.c: follow above change. * ext/pty/pty.c: follow above change. [ruby-dev:37893] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22078 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rdoc update.akr2009-02-041-2/+0
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rdoc update.akr2009-01-311-0/+11
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * revert previous revision. it's already out-of-date.usa2009-01-221-4/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21735 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/win32.h, win32/win32.c (rb_w32_is_valid_fd): new functionusa2009-01-221-2/+4
| | | | | | | | | | to validate fd. * io.c (rb_io_initialize): check fd with above function. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_ungetbyte, rb_io_ungetc): allows nil to reset EOFnobu2009-01-211-2/+2
| | | | | | | | | | flag with ungetting nothing. * ruby.c (load_file_internal): rests EOF flag to make possible to load from stdin after reading data. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21718 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_ungetbyte, rb_io_ungetc): clears EOF flag.nobu2009-01-211-1/+4
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21715 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/io.h (typedef struct rb_io_t):nobu2009-01-211-3/+15
| | | | | | | | | | | * io.c (flush_before_seek): * io.c (io_fillbuf): * io.c (io_fread): * io.c (io_getpartial): * ruby.c (load_file_internal): git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rdoc update.akr2009-01-151-10/+13
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21531 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (pipe_open): revert a part of previous commit. it may be ausa2009-01-151-6/+3
| | | | | | | | mistake. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21515 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * symbian/README.SYMBIAN: symbian support added. great appreciatematz2009-01-151-3/+10
| | | | | | to <alexandre.zavorine at symbian.com>. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_wait_readable, rb_io_wait_writable): need rb_fd_ptr.nobu2009-01-141-2/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (appendline): reformed.nobu2009-01-141-14/+9
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21503 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_s_pipe): reduced nest of rb_ensure of main block.nobu2009-01-141-3/+7
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21502 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (io_reopen, rb_io_init_copy): should register fptr to pipe_listusa2009-01-131-0/+8
| | | | | | | | when copying pipe fptr. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21495 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_close_read): call rb_io_fptr_cleanup() instead ofusa2009-01-131-1/+1
| | | | | | | | | fptr_finalize() because the fptr has special finalizser if it is a pipe. [ruby-dev:37757] (3) git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_initialize): workaround for Windows. [ruby-dev:37686]usa2009-01-131-0/+6
| | | | | | | | (also see [ruby-dev:37721]) git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21491 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_close_before_exec): more heuristics to detect maximum fd.akr2009-01-051-1/+6
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21347 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (maygvl_copy_stream_wait_read): renamed to add prefix toakr2009-01-031-17/+17
| | | | | | | | | | | | | express GVL state. (nogvl_copy_stream_wait_write): ditto. (nogvl_copy_stream_sendfile): ditto. (maygvl_copy_stream_read): ditto. (nogvl_copy_stream_write): ditto. (nogvl_copy_stream_read_write): ditto. (nogvl_copy_stream_func): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21288 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rdoc update.akr2008-12-311-0/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update rdoc.akr2008-12-311-0/+5
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (copy_stream_body): don't check to_io becauseakr2008-12-311-4/+2
| | | | | | | Zlib::GzipWriter#to_io returns the underlying IO. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21209 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* revert previous changes.naruse2008-12-291-1/+20
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_get_path): move encoding conversion of file pathnaruse2008-12-291-20/+1
| | | | | | | | from rb_scan_open_args. * io.c (rb_scan_open_args): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21146 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (fptr_finalize): don't allocate objects if noraise.akr2008-12-261-16/+29
| | | | | | | | | | (finish_writeconv): add noalloc argument to be able to avoid object allocation. (finish_writeconv_arg): introduced again. (finish_writeconv_sync): follow the above change. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (fptr_finalize): close the IO object even if finish_writeconv orakr2008-12-261-52/+39
| | | | | | | | | | | | | | | flush is failed. (finish_writeconv): don't raise. return errno or exception. (finish_writeconv_arg): removed. (finish_writeconv_sync): follow finish_writeconv change. * transcode.c (rb_econv_make_exception): new function. * include/ruby/encoding.h (rb_econv_make_exception): declared. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21059 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_s_pipe): unused variable removed.akr2008-12-251-3/+0
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21045 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (pipe_close): removed.akr2008-12-251-12/+3
| | | | | | | | (pipe_yield): defined. (rb_io_s_pipe): use pipe_yield. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20992 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_initialize): check fd validity. [ruby-dev:36646]akr2008-12-251-0/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20990 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (flush_before_seek): check io_fflush result.akr2008-12-251-14/+28
| | | | | | | | | | | | | | | | (rb_io_check_readable): ditto. (rb_io_flush): ditto. (rb_io_fsync): ditto. (remain_size): ditto. (rb_io_write_nonblock): ditto. (finish_writeconv): ditto. (fptr_finalize): ditto. (io_reopen): ditto. (rb_io_reopen): ditto. (copy_stream_body): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (io_fflush): flush write buffer without write lock inmatz2008-12-251-1/+8
| | | | | | | | finalizers. [ruby-dev:37572] * io.c (rb_io_fptr_finalize): clear write lock before finalizing. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20988 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (fptr_finalize): close the IO object even if close(2) is failed.akr2008-12-251-18/+11
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20987 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c: sorry, wrong commit. orzusa2008-12-251-10/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_flush): fsync() after buffer is flushed on win32.usa2008-12-251-2/+13
| | | | | | | | [ruby-core:20043] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_init_copy): call io_seek only if io_tell succeeds.akr2008-12-231-1/+4
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20954 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (rb_fork): propagete an error message from child to parent.akr2008-12-231-9/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (rb_f_exec): show details of error in child process on exception. (save_redirect_fd): add error message arguments. (run_exec_dup2): ditto. (run_exec_close): ditto. (run_exec_open): ditto. (run_exec_dup2_child): ditto. (run_exec_pgroup): ditto. (run_exec_rlimit): ditto. (rb_run_exec_options): ditto. (rb_exec): ditto. (rb_exec_atfork): ditto. (rb_spawn_internal): ditto. (rb_spawn): ditto. (rb_f_system): follow arguments change. (proc_daemon): ditto. (rb_f_spawn): show details of error in child process on exception. * io.c (popen_exec): add error message arguments. (pipe_open): show details of error in child process on exception. * include/ruby/intern.h (rb_run_exec_options): add error message arguments. (rb_exec): ditto. (rb_fork): ditto. (rb_spawn): ditto. * ext/pty/pty.c (chfunc): add error message arguments. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20950 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c: rdoc for File::open and 1.9 feature in file modes.yugui2008-12-231-28/+95
| | | | | | * transcode.c: rdoc for String#encode git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20946 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_inspect): show fd number if there is no pathname.akr2008-12-231-4/+18
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20940 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (pipe_open): need to initialize args.usa2008-12-231-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (pipe_close): fix coding style. [ruby-dev:37554]akr2008-12-231-2/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20928 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rdoc update.akr2008-12-221-0/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20917 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_s_pipe): IO.pipe can take a block.akr2008-12-221-3/+33
| | | | | | | (pipe_close): new function. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dln.c (dln_find_1): supplements an extension for executablenobu2008-12-201-10/+6
| | | | | | | | | | | | | | | | | files on DOSish platforms. * io.c (pipe_open): use rb_w32_aspawn() for array form. * win32/win32.c (rb_w32_pipe_exec): no longer used. * win32/win32.c (rb_w32_spawn, rb_w32_aspawn): deals with batch files and commands with extensions. [ruby-core:20695] * win32/win32.c (has_redirection): supports environment variables references. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20892 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_extract_encoding_option): "internal_encoding: nil"matz2008-12-191-38/+43
| | | | | | | | | | to specify no-transcoding. and other corner case fixed. [ruby-dev:37496] * hash.c (rb_hash_lookup2): new function to look-up hash with default value. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20870 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rdoc update.akr2008-12-101-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (io_binwrite): arg.offset should be updated after retry.akr2008-12-041-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e