我在 Julia 中打开了一个文件:
output_file = open(path_to_file, "a")
我想砍掉文件的最后六个字符。我以为我可以用chopie 做到这一点,chop(output_file; tail = 6)但它似乎只适用于Stringtype 而不是IOStream. 我应该怎么做?
julia> rbothpoly(0, 1, [5], 2, 30, "html")
ERROR: MethodError: no method matching chop(::IOStream; tail=6)
Closest candidates are:
chop(::AbstractString; head, tail) at strings/util.jl:164
Stacktrace:
[1]
[...] ERROR STACKTRACE [...]
[3] top-level scope at REPL[37]:1
我是 IOStream 的新手,今天才发现它们。