Escript: setting code path relative to script directory

夙愿已清 提交于 2019-12-05 04:35:12

Just found it out myself:

At the beginning of main add code like this:

true = code:add_pathz(filename:dirname(escript:script_name()) 
                       ++ "/../dir-of-some-beams"),

I recommend always testing for true whith these code functions, because its easy to type code:add_pathsz which wants a list of strings and always returns ok, even if you pass it just a string -- but it doesn't set the code path to the single directory (which is pretty annoying behaviour btw).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!