Compile, Delete, Purge and Load

Gordon Guthrie, BTP, BT, SE gordon.guthrie@REDACTED
Fri Mar 12 15:34:22 CET 2004


Apologies to all for going off prematurely on this e-mail, thick fingers
today...

 
Folks
 
I am developing away in Erlang. I have a setup routine that 
creates an mnesia database and does some things to it, gets 
tables set up right and clean. I step through my code in the 
debugger and make changes, etc, etc.

In order to speed things up and not have to recreate the 
environment I have written a little routine that basically 
does the following for all my modules:

   Results999_G =
compile:file("/opt/erlang_apps/swarm/lib/html_fragments-V1/src/sms_shim.erl"
, [debug_info, {outdir,
"/opt/erlang_apps/swarm/lib/html_fragments-V1/ebin"}]),
    io:fwrite("G) sms_shim: ~30s~n", [io_lib:write(Results999_G)]),

    code:delete(sms_shim),
    code:purge(sms_shim),
    code:load_file(sms_shim),

When I haven't loaded the debugger on a particular module this is fine and
the new version is loaded and ready to roll, but when I have looked at a
module in the debugger this routine tells me:

	module sms_shim must be purged before loading

and I have to halt the Erlang shell, restart it and reinitialise everything
again.

How do I get a 'debugged' function to purge?

Gordon

______________________________________________________________________
Scottish Enterprise Network
http://www.scottish-enterprise.com

Address & Contact Numbers

150 Broomielaw
5 Atlantic Quay
Glasgow
G2 8LU.
Tel:  +44 (0)141 248 2700.
Fax:  +44 (0)141 221 3217

message is sent in confidence for the addressee only.
It may contain legally privileged information. The contents are not to
be disclosed to anyone other than the addressee. Unauthorised recipients
are requested to preserve this confidentiality and to advise the sender
immediately of any error in transmission.





More information about the erlang-questions mailing list