<div dir="ltr">I am reading programming erlang (2nd Ed.) and get a little confused by the exercise 16-6.<br><div><br></div><div>Here is the question</div><div><br></div><div>Twits are exactly 140 bytes long. Write a random-access twit storage module called twit_store.erl that exports the following: init(K) allocates space for K twits. store(N, Buf) stores twit number N(1,...K) with data Buf (a 140-byte binary) in the store. fetch(N) fetches the data for twit number N.</div><div><br></div><div>I am confused by the meaning of init(K). I try to use function file:allocate but always get a result of {error, einval}. Could anyone help me?</div></div>