Read a file character by character/UTF8: Difference between revisions
Read a file character by character/UTF8 (view source)
Revision as of 01:51, 30 September 2022
, 1 year agono edit summary
Thundergnat (talk | contribs) m (syntax highlighting fixup automation) |
No edit summary |
||
Line 1,371:
<syntaxhighlight lang="tcl">fconfigure $channel -buffersize $byteCount</syntaxhighlight>
When the channel is only being accessed from Tcl (or via Tcl's C API) it is not normally necessary to adjust this option.
=={{header|Vlang}}==
<syntaxhighlight lang="vlang">
import os
fn main() {
file := './file.txt'
mut content_arr := []u8{}
if os.is_file(file) == true {
content_arr << os.read_bytes(file) or {
println('Error: can not read')
exit(1)
}
}
else {
println('Error: can not find file')
exit(1)
}
println(content_arr.bytestr())
}
</syntaxhighlight>
=={{header|Wren}}==
|