summaryrefslogtreecommitdiff
path: root/io.c
Commit message (Collapse)AuthorAgeFilesLines
* `rb_io_puts` should not write zero length strings. (#7806)Samuel Williams2023-05-151-16/+24
|
* [Bug #19624] Hide internal IO for backquoteNobuyoshi Nakada2023-05-011-0/+1
|
* [DOC] Fix typosNobuyoshi Nakada2023-04-131-3/+3
|
* [Bug #19584] Register global variables before assignmentNobuyoshi Nakada2023-04-071-4/+3
|
* [Feature #19474] Refactor NEWOBJ macrosMatt Valentine-House2023-04-061-1/+1
| | | | NEWOBJ_OF is now our canonical newobj macro. It takes an optional ec
* Support `IO#pread` / `IO#pwrite` using fiber scheduler. (#7594)Samuel Williams2023-03-311-10/+32
| | | * Skip test if non-blocking file IO is not supported.
* Raise ArgumentError if IO.read is provided negative offsetJeremy Evans2023-03-241-0/+4
| | | | Fixes [Bug #19380]
* [DOC] Clarify IO#autoclose impact on #closeLars Kanis2023-03-011-6/+6
| | | Mention that autoclose changes the behavior of explicit close in addition to implicit close at IO finalization.
* Fix spelling (#7405)John Bampton2023-02-281-1/+1
|
* Adjust `else` style to be consistent in each files [ci skip]Nobuyoshi Nakada2023-02-261-4/+8
|
* Remove (newly unneeded) remarks about aliasesBurdetteLamar2023-02-191-13/+0
|
* [DOC] Document IO::Timeoutzverok2023-02-191-1/+5
|
* Make IO#set_encoding with binary external encoding use nil internal encodingJeremy Evans2023-01-011-2/+13
| | | | | | | | | | | | | | This was already the behavior when a single `'external:internal'` encoding specifier string was passed. This makes the behavior consistent for the case where separate external and internal encoding specifiers are provided. While here, fix the IO#set_encoding method documentation to state that either the first or second argument can be a string with an encoding name, and describe the behavior when the external encoding is binary. Fixes [Bug #18899]
* Docs: path: option for IO.newzverok2022-12-231-0/+2
|
* [DOC] IO#read doesn't always read in binary modeAlan Wu2022-12-221-5/+3
| | | | | | | | | | | | When `maxlen` is `nil`, it uses the data mode of the stream. For example in the following: ```ruby File.binwrite("a.txt", "\r\n\r") p File.open("a.txt", "rt").read # "\n\n" p File.open("a.txt", "rt").read(3) # "\r\n\r" ``` Note, this newline translation is _not_ specific to Windows.
* Introduce `IO.new(..., path:)` and promote `File#path` to `IO#path`. (#6867)Samuel Williams2022-12-081-2/+41
|
* io.c (read_all): grow the buffer exponentially when size is unknownJean Boussier2022-12-021-2/+16
| | | | | | | | [Feature #6047] Currently it's grown by `BUFSIZ` (1024) on every iteration which is bit wasteful. Instead we can double the capacity whenever there is less than `BUFSIZ` capacity left.
* Introduce encoding check macroS-H-GAMELINKS2022-12-021-2/+2
|
* Introduce argf_encoding functionS-H-GAMELINKS2022-12-021-8/+13
|
* Reuse NIL_OR_UNDEF_P macroS-H-GAMELINKS2022-12-021-1/+1
|
* Using UNDEF_P macroS-H-GAMELINKS2022-11-161-19/+19
|
* [DOC] Enhanced RDoc for IO (#6669)Burdette Lamar2022-11-091-112/+436
|
* [DOC] Enhanced RDOc for IO (#6642)Burdette Lamar2022-10-291-25/+84
| | | | | | | In io.c treats: #close #close_read #close_write #closed
* Update `Fiber::Scheduler` documentation. (#6562)Samuel Williams2022-10-151-3/+1
|
* Introduce `Fiber::Scheduler#io_select` hook for non-blocking `IO.select`. ↵Samuel Williams2022-10-151-0/+9
| | | | (#6559)
* Copy `IO#timeout` on `IO#dup`. (#6546)Samuel Williams2022-10-151-0/+1
|
* Ignore failure to set nonblock mode. (#6524)Samuel Williams2022-10-111-2/+2
|
* Try `nil` as default for 'default timeout'. (#6509)Samuel Williams2022-10-081-9/+14
|
* Add IO#timeout attribute and use it for blocking IO operations. (#5653)Samuel Williams2022-10-071-71/+265
|
* [DOC] Integrate io_streams.rdoc into io.c (#6491)Burdette Lamar2022-10-061-14/+33
| | | Integrate io_streams.rdoc into io.c
* [DOC] RDoc changes for IO (#6458)Burdette Lamar2022-10-021-363/+66
| | | | | | Moves Expect library doc into io.c. Changes certain links to local sections, now pointing to sections in doc/io_streams.rdoc. Removes local sections now superseded by sections in doc/io_streams.rdoc.
* [ci skip] Fix typos in documentation in io.cPeter Zhu2022-09-161-2/+2
|
* [Win32] Negative length `IO#sysread`Jeremy Bopp2022-09-111-1/+2
| | | | | | Raise `ArgumentError` in `IO#sysread` on Windows when given a negative length. Fixes [Bug #18880]
* [Bug #5317] Use `rb_off_t` instead of `off_t`Nobuyoshi Nakada2022-09-081-82/+74
| | | | Get rid of the conflict with system-provided small `off_t`.
* Raise ArgumentError for IO.foreach with limit of 0Jeremy Evans2022-08-251-0/+2
| | | | | | Makes behavior consistent with IO.readlines. Fixes [Bug #18767]
* [DOC] Mention Windows text mode EOF marker interpretationAlan Wu2022-08-051-2/+4
| | | | | | | | | I don't think this is super well known so it's worth mentioning as it can be a pitfall. See: https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/fopen-wfopen?view=msvc-170 Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
* [DOC] Clarify that `IO.read` uses text modeAlan Wu2022-08-051-1/+5
| | | | | | See: https://bugs.ruby-lang.org/issues/18882#note-13 [Bug #18882]
* [DOC] Cross references for `ARGF`Nobuyoshi Nakada2022-07-281-61/+61
|
* Fix documentation for ARGF.inplace_mode{,=}Jeremy Evans2022-07-271-7/+8
| | | | | | | The value affects the name of the backup file created, not the name of the file modified (as the file is modified in place). Fixes [Bug #18920]
* Adjust styles [ci skip]Nobuyoshi Nakada2022-07-271-2/+4
|
* [DOC] IO#eofKaíque Kandy Koga2022-07-231-1/+1
| | | | Use IO#eof? instead of I#eof?
* Do not chomp trailing line separator IO#each with nil separator and chompJeremy Evans2022-07-211-1/+0
| | | | | | | nil separator means no sepator, so chomp should not remove a line separator. Partially Fixes [Bug #18770]
* Expand tabs [ci skip]Takashi Kokubun2022-07-211-1813/+1813
| | | | [Misc #18891]
* Revert "Do not chomp trailing line separator IO#each with nil separator and ↵Jeremy Evans2022-07-211-0/+1
| | | | | | | | chomp" This reverts commit 04f86ad0b5d2fe4711ff300d855228a6aed55f33. This is causing CI issues, reverting for now.
* Do not chomp trailing line separator IO#each with nil separator and chompJeremy Evans2022-07-211-1/+0
| | | | | | | nil separator means no sepator, so chomp should not remove a line separator. Partially Fixes [Bug #18770]
* [DOC] Fix documentation for ARGF#readlinesPeter Zhu2022-07-151-4/+4
| | | | [Bug #18909]
* [DOC] Fix typo in documentation for IO#readlinesPeter Zhu2022-07-141-1/+1
|
* [Bug #18892] Reset `ARGF.lineno` after reading shebangNobuyoshi Nakada2022-07-071-0/+6
|
* [Bug #18898] Fallback invalid external encoding to the defaultNobuyoshi Nakada2022-07-061-1/+3
|
* Copy `IO#wait*` methods from `io-wait` gem to `io.c`.Samuel Williams2022-06-251-0/+217
|