[erlang-questions] case error

8 views
Skip to first unread message

Wes James

unread,
Nov 9, 2011, 10:29:26 PM11/9/11
to erlang-q...@erlang.org
I have a case like this:

case file:read_file(Args) of
{ok, Data} ->
...;
{error, Reason} ->
....
end;

but when I run the code I get:


exit value: {{case_clause,{ok,<<524 bytes>>}},[{module,fun,1}]}

What am I doing wrong here?

thanks,

-wes
_______________________________________________
erlang-questions mailing list
erlang-q...@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions

József Bérces

unread,
Nov 9, 2011, 10:34:26 PM11/9/11
to Wes James, erlang-q...@erlang.org
Hi Wes,

I would suspect that you assigned some value to the variable Data in the same function earlier. So now it does not match the info read from the file.

BR,
Jozsef

Wes James

unread,
Nov 9, 2011, 10:44:15 PM11/9/11
to József Bérces, erlang-q...@erlang.org
Argh - you are right, there is a Data above that - Thanks!

I kept thinking the structure of this didn't seem wrong.

Thanks again,

-wes

2011/11/9 József Bérces <jozsef...@ericsson.com>:

Reply all
Reply to author
Forward
0 new messages