[erlang-questions] posregex error: RE_drv not found
YC
yinso.chen@REDACTED
Fri Oct 5 22:07:36 CEST 2007
Ah - I figured out that I just need to use
erl_ddll:load_driver(code:priv_dir(posregex),
'RE_drv') to make it work - thanks!
yc
On 10/5/07, YC <yinso.chen@REDACTED> wrote:
>
> That does it!! Thanks! I didn't realize I have to load the driver
> manually.
>
> It seem to make sense if the loading process can be automated. Read
> through the erl_ddll doc it seems the try_load function can be used even
> when the driver is already loaded. But I'm wondering about the path - it
> seems that it actually need a physical path. I thought erlang already know
> where the lib exists, or do I have to manually concat the path and pass to
> the load function?
>
> Thanks,
> yc
>
> On 10/5/07, yerl@REDACTED <yerl@REDACTED > wrote:
> >
> > Hi !
> >
> > The README isn't clear enough.
> > Follow this one:
> >
> > 1. Compile your regexp.
> >
> > $ make
> > $ erl +Ktrue -pa ebin/
> >
> > 1> erl_ddll:load_driver("./priv", 'RE_drv').
> > 2> erl_ddll:loaded_drivers().
> >
> > 4> {ok, RE} = posregex:compile(<<"abc.*foo">>, [extended]).
> > {ok,#Port<0.101>}
> >
> >
> > Try to match something
> >
> > 7> posregex:match(RE, <<"abc mre text here foo">>, []).
> > ok
> >
> >
> > If it doesn't match
> >
> > 9> posregex:match(RE, <<"abdc mre text here foo">>, []).
> > {error,nomatch}
> >
> >
> > Try to match and find out where the match occured
> >
> > 10> posregex:exec(RE, <<"abc mre text here foo">>, []).
> > {ok,[{0,21}]}
> >
> >
> > Free memory occupied by the compilation (or exit process since
> > RE is an erlang port)
> >
> > 11> posregex:free(RE).
> > ok
> >
> >
> > cheers
> > Y.
> > ----Message d'origine----
> > >Date: Fri, 5 Oct 2007 01:10:34 -0700
> > >De: YC
> > >A: erlang-questions@REDACTED
> > >Sujet: [erlang-questions] posregex error: RE_drv not found
> > >
> > >
> > >
> > >Hi -
> > >
> > >I downloaded posregex and compile on my machine per the suggestion of
> > the
> > >thread
> > >http://www.erlang.org/pipermail/erlang-questions/2007-September/029492.html
> > .
> > >I'm able to make and sudo make install, but when I try to run it in
> > erlang I
> > >encounter the following message:
> > >
> > >2> {ok, RE} = posregex:compile(<<"abc.*def">>,[extended]).
> > >sh: line 0: exec: RE_drv: not found
> > >
> > >BREAK: (a)bort (c)ontinue (p)roc info (i)nfo (l)oaded
> > > (v)ersion (k)ill (D)b-tables (d)istribution
> > >
> > >And not sure how to proceed from here. I tried both 1.0 & 1.0.1 with
> > the
> > >same results.
> > >
> > >Any insights are appreciated, thanks.
> > >
> > >yc
> > >
> > >_______________________________________________
> > >erlang-questions mailing list
> > >erlang-questions@REDACTED
> > >http://www.erlang.org/mailman/listinfo/erlang-questions
> > >
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20071005/374bb40e/attachment.htm>
More information about the erlang-questions
mailing list