exporting a new function in prim_file.erl

Filipe David Manana <>
Wed Apr 21 18:18:12 CEST 2010


I'm trying to add a new function to prim_file.erl that will be called by
file_io_server.erl. Therefore I export it in the first export macro.

This new function happens to have exactly the same interface (arity and arg
type, return values) as prim_file:sync/1, so I copied the sync function
clause, renamed it, and added the corresponding export.

After building and installing OTP, I get an error when calling

=ERROR REPORT==== 21-Apr-2010::16:30:53 ===
Error in process <0.35.0> with exit value:

file:my_func/1 just calls file_io_server:my_func/1 wich in turn calls

It seems that prim_file is not exporting  my_func. Yet I have an explicit
"-define([... sync/1 my_func/1 ...])."

The Erlang shell is not recognizing prim_file:my_func/1 (through tab auto

My code path also seems to be correct.

What am I missing here?


Filipe David Manana,

"Reasonable men adapt themselves to the world.
Unreasonable men adapt the world to themselves.
That's why all progress depends on unreasonable men."

More information about the erlang-patches mailing list