views:

157

answers:

1

I have two questions regarding Erlang file i/o; what is the best way to achieve in Erlang:

  1. reading large binary files (many gigabytes) without copying the whole file into memory
  2. reading a gzipped binary file as a decompressed stream

Thanks!

+2  A: 
  1. See file:read/2 for sequential block access and file:pread/2,3 for random access.
  2. See compressed option in file:open/2.
Hynek -Pichi- Vychodil
I might have to figure out something that's higher performance for production, but this works very well for prototyping.
Erlang
Do you have measured or just guessing? I'm pretty satisfied with `file:read/2` when opened file using `[raw, binary, read_ahead]` and using block oriented processing. What performance you expect?
Hynek -Pichi- Vychodil