I can be wrong with slash because I've never used Erlang under Win.
jilani.khaldi> Hi All,
jilani.khaldi> how to load "c:\abc\mymodule.beam" from werl shell?
jilani.khaldi> I have put l("/abc/mymodule.beam/").
jilani.khaldi> -> Error
jilani.khaldi> Jilani Khaldi
jilani.khaldi> http://www.jilani.net jilani.khaldi>
>That's Ok, but it loads only the module but not the "*.gif"
>images inside "c:/abc" that the module uses, and it aborts.
An OTPish way of doing things would be to organize your code
into applications like in the OTP code tree:
You can then use the function code:priv_dir(myapp) and find
$MYROOT/lib/myapp-1.0/priv/. From there, you can e.g. slap
on an imgs/ subdirectory and fetch your files.
Another method would be to maintain a variable pointing to
your personal files. This can be done in many ways.
- If you want to specify an OS environment variable, you can
do so, and fetch the location using os:getenv(Variable)
- If you want to specify the location as an argument to
the 'erl' command, you are free to do so:
Eshell V126.96.36.199 (abort with ^G)
- You can store a value in Mnesia, of course
You can also use code:which(?MODULE) in your code to find
the location of your .beam file. This is a questionable
tactic, since it will be misleading if the module has been
loaded from a patch directory.
I'm sure there are other, perhaps better, ways, but those
were some alternatives off the top of my head.
Ulf Wiger, Senior Specialist,
/ / / Architecture & Design of Carrier-Class Software
/ / / Strategic Product & System Management
/ / / Ericsson AB, Connectivity and Control Nodes