[erlang-questions] Obsolete exported functions file:raw_{read, write}_file_info/2 - why?

Scott Lystig Fritchie fritchie@REDACTED
Wed Sep 14 18:42:37 CEST 2011

Joseph Norton <norton@REDACTED> wrote:

jn> I'm curious if someone happens to know why the
jn> file:raw_read_file_info/1 and file:raw_read_file_info/2 methods were
jn> made obsolete?

Joe, I stumbled across those functions while putting DTrace probes into
the efile_drv driver.  I thought, hey, those would be quite useful.

I recommend reading the file.erl source.  It's quite instructive to see
how many file I/O functions are redirected to the 'file_server_2'
process.  For file I/O-intensive applications (e.g. Hibari and Riak I
know, CouchDB and RabbitMQ I'd guess), having all calls to(*)
file:read_file_info/1 serialized by the file server process is a source
of latency that we (DB authors) may desire to live without.

Having planted bugs in prim_file.erl accidentally, it is also quite
instructive to see how many different ways the VM's bootstrap process
can be broken.  So I now understand reluctance to deprecate functions
that may be necessary at some weird situation when booting.  However,
there may come a time when some of us submit a patch to expose *more*
raw file I/O functions in file.erl, not fewer.


(*) Or file:delete/1 or file:rename/2 or ...

More information about the erlang-questions mailing list