simple question

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

simple question

=?iso-8859-1?Q? Jonas=20Dagef=F6rde ?=
Dear Sir or Madam,
I'm trying to start "erl" or "werl" under Windows 98 with the argument "-pa <directory>" and/or "-pz <directory>". I can see the key/value pair in the argument list returned by "init:get_arguments()". But if I try to load a module with "c(mymodule)", erlang doesn't find it, if it is in the "own_files" directory. What can I do so that I don't have to put all my source and header files in the "C:\Programme\erl5.0.2" directory?

With regards
Jonas Dagef?rde
______________________________________________________________________________
Ferienklick.de - 225 Reisekataloge auf einen Blick!
Direkt zu Ihrem Traumurlaub: http://ferienklick.de/?PP=2-0-100-105-0


Reply | Threaded
Open this post in threaded view
|

simple question

Luke Gorrie-3
"Jonas Dagef?rde" <jdagefoerde> writes:

> Dear Sir or Madam, I'm trying to start "erl" or "werl" under Windows
> 98 with the argument "-pa <directory>" and/or "-pz <directory>". I can
> see the key/value pair in the argument list returned by
> "init:get_arguments()". But if I try to load a module with
> "c(mymodule)", erlang doesn't find it, if it is in the "own_files"
> directory. What can I do so that I don't have to put all my source and
> header files in the "C:\Programme\erl5.0.2" directory?

c(mymodule) actually compiles (and loads) the mymodule.erl file down
to mymodule.beam. It does this in the current directory, so you'll
want to do:

  cd("c:/directory/with/my/module/").

Before doing c(mymodule)

Using "-pa" makes erlang automatically load the module (from the .beam
file) from that directory when its needed, if its already compiled. So
you can use it for pointing erlang at the code that you've already
c()'d.

Cheers,
Madam Luke


Reply | Threaded
Open this post in threaded view
|

simple question

Martin Bjorklund-2
Luke Gorrie <luke> wrote:

> "Jonas Dagef?rde" <jdagefoerde> writes:
>
> > Dear Sir or Madam, I'm trying to start "erl" or "werl" under Windows
> > 98 with the argument "-pa <directory>" and/or "-pz <directory>". I can
> > see the key/value pair in the argument list returned by
> > "init:get_arguments()". But if I try to load a module with
> > "c(mymodule)", erlang doesn't find it, if it is in the "own_files"
> > directory. What can I do so that I don't have to put all my source and
> > header files in the "C:\Programme\erl5.0.2" directory?
>
> c(mymodule) actually compiles (and loads) the mymodule.erl file down
> to mymodule.beam.

And if you have the compiled (.beam) file in your path, you can do
l(mymodule) to load it.

I.e. c(mymodule) compiles mymodule.erl from *current dir* to
                 mymodule.beam, and loads mymodule.beam

     l(mymodule) loads mymodule.beam from the code path (code:get_path()).


/martin