[erlang-questions] slow file I/O (was Not an Erlang fan)

Claes Wikstrom <>
Thu Sep 27 20:46:05 CEST 2007

Originally at Bluetail, we had some serious problems with
high performance file I/O, especially line oriented such.

I then wrote a portable (yes win32 too) linked in driver
for fast FILE I/O. It's based on an old and hacked version
of the BSD FILE* interface. It's called bfile and we've
been using it in pretty much all projects during the past 8
years. I've prepared a tarball of it at


Here's an (slightly edited) example shell session:

2> bfile:load_driver().
4> {ok, Fd} = bfile:fopen("Makefile", "r").
5> bfile:fgets(Fd).
6> bfile:fgets(Fd).
7> bfile:fgets(Fd).
14> bfile:fread(Fd, 10000).
15> bfile:fread(Fd, 10000).

It should be equally fast as the same code in C.



More information about the erlang-questions mailing list