<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Arial;color: #000000;font-size: 10pt;">Hi,<br>
<br>
AFAIK, the layout you propose under 1. is correct. Additionally, the code server is also able to handle something like this (application name and version):<br>
<br>
<div>bob-1.0.0/ebin/bob.beam</div>
<div>bob-1.0.0/ebin/bob.app.src</div>
<div>mary-2.0.0/ebin/mary.app.src</div>
<div>mary-2.0.0/ebin/mary.beam<br>
<br>
Packaging priv directories doesn't make much sense, since there's no automagic way to get the files' content at runtime. Even if you package priv directories in a standard location (in your case bob/priv/secret.code), the code server will return a non-existent
 path for code:priv_dir(bob) and you can't access the files with the file module. You'll have to use the erl_prim_loader module to extract file contents (other than .beam) from .ez archives (this also applies for embedded archives). I worked around this limitation
 when writing the rebar_escript_plugin [1] to create standalone escripts. Look at the rebar_escript_plugin_runner module to see erl_prim_loader in action.<br>
<br>
Regards<br>
Tobias<br>
<br>
[1] https://github.com/schlagert/rebar_escript_plugin<br>
<br>
</div>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF674194"><font color="#000000" size="2" face="Tahoma"><b>Von:</b> erlang-questions-bounces@erlang.org [erlang-questions-bounces@erlang.org]" im Auftrag von "Felix Gallo [felixgallo@gmail.com]<br>
<b>Gesendet:</b> Sonntag, 23. August 2015 02:15<br>
<b>An:</b> erlang-questions@erlang.org<br>
<b>Betreff:</b> [erlang-questions] escript standard archive layout<br>
</font><br>
</div>
<div></div>
<div>
<div dir="ltr">I've recently had the opportunity to dive into escripts a little.  Fascinating.  
<div><br>
</div>
<div>I haven't been able to glean a few things from the documentation, however, and if anyone has experience with escripts, I'd love to hear their thoughts.</div>
<div><br>
</div>
<div>1.  It looks like, if your OTP application named 'bob' with one dependency 'mary' looks like this:</div>
<div><br>
</div>
<div>src/bob.erl</div>
<div>ebin/bob.beam</div>
<div>ebin/bob.app.src</div>
<div>deps/mary/src/mary.erl</div>
<div>deps/mary/ebin/mary.beam</div>
<div>deps/mary/ebin/mary.app.src</div>
<div>priv/secret.code</div>
<div><br>
</div>
<div>that the code module wants to get an {archive, ZippedBinary} block that unzips to</div>
<div><br>
</div>
<div>bob/ebin/bob.beam</div>
<div>bob/ebin/bob.app.src</div>
<div>mary/ebin/mary.app.src</div>
<div>mary/ebin/mary.beam</div>
<div>priv/secret.code</div>
<div><br>
</div>
<div>is that, for want of a formal document, the accepted right way of forming an archive block, all else being equal?</div>
<div><br>
</div>
<div>2.  Is there an escript 2nd-line (%%!) best practice/optimal options for most standard escripts that some old timer can recommend?</div>
<div><br>
</div>
<div>F.</div>
</div>
</div>
</div>
</div>
</body>
</html>