I created a new file, based on OTP gen_server behaviour.
This is the begining of it:
-module(appender_server).
-behaviour(gen_server).
-export([start_link/1, stop/0]).
-export([init/1, handle_call/3, handle_cast/2]).
start_link(filePath) ->
gen_server:start_link({local, ?MODULE}, ?MODULE, filePath, []).
init(filePath) ->
{ok, theFile} = file:open(filePath, [append]). % File is created if it does not exist.
...
The file compiled ok using c(appender_server).
When I try to call start_link function from the shell, like this:
appender_server:start_link("c:/temp/file.txt").
I get:
** exception error: no function clause matching appender_server:start_link("c:/temp/file.txt") (appender_server.erl, line 10)
What do I do wrong?