Skip to content

Commit 02b4dcc

Browse files
kshyattfredrikekre
authored andcommitted
Even more io doctests (#24928)
1 parent 7e386f0 commit 02b4dcc

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

base/io.jl

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,45 @@ function readavailable end
6565
isreadable(io) -> Bool
6666
6767
Return `true` if the specified IO object is readable (if that can be determined).
68+
69+
# Examples
70+
```jldoctest
71+
julia> open("myfile.txt", "w") do io
72+
write(io, "Hello world!");
73+
isreadable(io)
74+
end
75+
false
76+
77+
julia> open("myfile.txt", "r") do io
78+
isreadable(io)
79+
end
80+
true
81+
82+
julia> rm("myfile.txt")
83+
```
6884
"""
6985
function isreadable end
7086

7187
"""
7288
iswritable(io) -> Bool
7389
7490
Return `true` if the specified IO object is writable (if that can be determined).
91+
92+
# Examples
93+
```jldoctest
94+
julia> open("myfile.txt", "w") do io
95+
write(io, "Hello world!");
96+
iswritable(io)
97+
end
98+
true
99+
100+
julia> open("myfile.txt", "r") do io
101+
iswritable(io)
102+
end
103+
false
104+
105+
julia> rm("myfile.txt")
106+
```
75107
"""
76108
function iswritable end
77109
function copy end

0 commit comments

Comments
 (0)