[erlang-questions] eldap:search result

John R. Ashmun john.ashmun@REDACTED
Sun Jan 12 21:50:22 CET 2014


I offer this approach:

{ok, Result} = eldap:search(S, Search),
eldap:close(S),
{eldap_search_result, [{_, _, [{"status", [Status]}]}], []} = Result,

& at this point, Status =:= "available", if I have successfully
balanced the brackets and braces.  You may wish also to match 'eldap_entry'
in your assignment.

Regards,
John R. Ashmun


On Sun, Jan 12, 2014 at 11:41 AM, Thomas Elsgaard <thomas.elsgaard@REDACTED
> wrote:

> Hi list
>
> I am experimenting with eldap, but i am wondering on how to correctly get
> the result from an ldap search?
>
> In my module, i am doing an eldap:search
>
> -----------------
> {ok, Result} = eldap:search(S, Search),
> eldap:close(S),
> io:format("Search Result: ~p~n", [Result]).
> -----------------
>
> And i am getting following:
>
> -----------------
> Search Result: {eldap_search_result,
>                    [{eldap_entry,
>                         "blaa,blaaa,blaa,blaa,blaa",
>                         [{"status",["available"]}]}],
>                    []}
> ok
> -----------------
>
> So far so good, eldap is doing it's work, but what i am really interrested
> in is just the content of the attribute status which is "available". How
> can i get the status into an variable? Do i need to get it from an record,
> or ?
>
> Thomas
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140112/3ed9f474/attachment.htm>


More information about the erlang-questions mailing list