JoGr
JoGr

Reputation: 1557

Erlang, reading a file with character offset

I have code to find a specific occurance of text in a file and give me an offset so I know where this occurance end. Now I want to read the file from that offset to the end of the file. The file contains binary data as well as text. How do I do this in Erlang?

Upvotes: 2

Views: 393

Answers (1)

Vijay Mathew
Vijay Mathew

Reputation: 27164

Use pread. (See Erlang documentation on the file module). You have to take care of any character encoding yourself as the function deals with only bytes.

Upvotes: 5

Related Questions