File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
src/main/ruby/truffleruby/core Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -1065,6 +1065,7 @@ def binmode
1065
1065
end
1066
1066
1067
1067
def binmode?
1068
+ ensure_open
1068
1069
!Primitive . nil? ( @binmode )
1069
1070
end
1070
1071
@@ -1454,6 +1455,7 @@ def eof?
1454
1455
end
1455
1456
1456
1457
def external_encoding
1458
+ ensure_open
1457
1459
if @mode & FMODE_WRITABLE == 0
1458
1460
@external || Encoding . default_external
1459
1461
else
@@ -1487,6 +1489,7 @@ def fcntl(command, arg=0)
1487
1489
end
1488
1490
1489
1491
def internal_encoding
1492
+ ensure_open
1490
1493
@internal
1491
1494
end
1492
1495
@@ -1611,7 +1614,7 @@ def gets(sep_or_limit=$/, limit=nil)
1611
1614
# f.gets #=> "This is line two\n"
1612
1615
# f.lineno #=> 2
1613
1616
def lineno
1614
- ensure_open
1617
+ ensure_open_and_readable
1615
1618
@lineno
1616
1619
end
1617
1620
@@ -1628,7 +1631,7 @@ def lineno
1628
1631
# f.gets #=> "This is line two\n"
1629
1632
# $. # lineno of last read #=> 1001
1630
1633
def lineno = ( line_number )
1631
- ensure_open
1634
+ ensure_open_and_readable
1632
1635
@lineno = Integer ( line_number )
1633
1636
end
1634
1637
You can’t perform that action at this time.
0 commit comments