Dump module helpers - crownedgrouse/argos GitHub Wiki
Dump module helpers
Argonaut module helpers created with option aliases while decoding can be dumped on disk.
Exported functions
argos:dump/1
argos:dump(list()) -> ok.
argos:dump/2
argos:dump(list(), atom()) -> ok | {error, Module, Reason}.
Options
argos:dump/1 expect an existing directory name as argument.
argos:dump/2 expect an existing directory name as 1st argument and a module name as 2nd argument.
Usage
argos will try to dump all modules listed in current process registry argos_adhoc into a valid OTP directory structure under the root directory given as 1st argument. If argos_adhoc is empty, argos will check all loaded modules on the system and dump only argonaut modules created by option aliases. Those ones have a 'argos' attribute, but are also temporary created on disk in argos priv_dir under a directory called dump, and code path set to it.
Other argonaut modules are loaded in VM but are considered removed by code:module_status/1 because no Beam file is found in path. They can be used like any other module anyway.
Once dumped on disk, aliases modules code path is set to new path and temporary module in argos priv_dir is removed.
Example
See example.