3
我需要从文件中读取记录,每个文件长度为9个字节。我需要知道如何启动文件如何从Julia开始读取一个x字节的文件?
我需要从文件中读取记录,每个文件长度为9个字节。我需要知道如何启动文件如何从Julia开始读取一个x字节的文件?
看起来你正在寻找的seek
功能在不同的点读:
help?> seek
search: seek seekend seekstart ParseError setenv select select! selectperm
seek(s, pos)
Seek a stream to the given position.
尤其是你可能要
open(filename) do f
seek(f, n) # seek past nth byte
read(f, m) # read m bytes
end
还有skip
功能可能会有用
help?> skip
search: skip skipchars
skip(s, offset)
Seek a stream relative to the current position.
It nee ds显示你做了什么尝试,以及你得到了什么错误(如果有的话)。 [如何对问-A-好问题,StackOverflow上(http://stackoverflow.com/help/how-to-ask) – Irfan