mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Pass same mode parameter to IO.sysopen and IO.open in IO.read.
This commit is contained in:
@@ -93,8 +93,9 @@ class IO
|
||||
if path[0] == "|"
|
||||
io = IO.popen(path[1..-1], (opt[:mode] || "r"))
|
||||
else
|
||||
fd = IO.sysopen(path)
|
||||
io = IO.open(fd, opt[:mode] || "r")
|
||||
mode = opt[:mode] || "r"
|
||||
fd = IO.sysopen(path, mode)
|
||||
io = IO.open(fd, mode)
|
||||
end
|
||||
io.seek(offset) if offset > 0
|
||||
str = io.read(length)
|
||||
|
||||
Reference in New Issue
Block a user