exporting a new function in prim_file.erl

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


Hello,

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
file:my_func/1:

=ERROR REPORT==== 21-Apr-2010::16:30:53 ===
Error in process <0.35.0> with exit value:
{undef,[{prim_file,my_func[{file_descriptor,prim_file,{#Port<0.500>,7}}]},{file_io_server,file_request,2},{file_io_server,server_loop,1}]}

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

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
completion).

My code path also seems to be correct.

What am I missing here?

thanks,

-- 
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