table_info on remote table

tty@REDACTED tty@REDACTED
Fri Feb 24 14:06:48 CET 2006


Hi,

Thanks. This works. Guess I need to upgrade my Google-fu skills :)
Was there an explaination why we need to use the mnesia_frag access module for this to work ? Just curious.

tee

-------- Original Message --------
From: Fredrik Thulin <ft@REDACTED>
Apparently from: owner-erlang-questions@REDACTED
To: tty@REDACTED
Cc: erlang-questions@REDACTED
Subject: Re: table_info on remote table
Date: Fri, 24 Feb 2006 07:29:25 +0100

> On Friday 24 February 2006 03:32, tty@REDACTED wrote:
> > Hi,
> >
> > I have a question regarding table_info. How does one make it work
> > with a remote table ?
> ...
> 
> I beleive I had the same problem once. I got the following piece of code 
> from Chandrashekhar Mullaparthi, which solved it for me at least. Try 
> if it works for you or if your problem is actually another one.
> 
> %%--------------------------------------------------------------------
> %% Function: generic_table_info(Tab, Item)
> %%           Tab  = atom(), table name
> %%           Item = atom(), item we are interested in
> %% Descrip.: Get mnesia table information, regardless of where table
> %%           resides.
> %% Returns : term()
> %%--------------------------------------------------------------------
> generic_table_info(Tab, Item) ->
>     Info = fun(T, I) ->
>               mnesia:table_info(T, I)
>            end,
>     mnesia:activity(async_dirty, Info, [Tab, Item], mnesia_frag).
> 
> /Fredrik



More information about the erlang-questions mailing list