erlang
friendan
快乐源于分享丶
展开
-
erlang获取文件大小
% {_, FileInfo} = file:read_file_info("/data/webtest/_rel/webtest_release/lib/webtest-0.1.0/priv/static/img/slip/1.txt"). {_, FileInfo} = file:read_file_info(FilePath), FileSize = element(2, FileInfo),原创 2020-07-12 21:07:45 · 257 阅读 · 0 评论 -
erlang获取应用名字
AppName = application:get_application(self()), io:format("webtest_app AppName=~p~n", [AppName]), ... 结果: webtest_app AppName={ok,webtest}原创 2020-07-12 20:33:29 · 213 阅读 · 0 评论 -
erlang cowboy获取根目录,获取priv目录路径
想在cowboy中获取priv的目录路径,如何获取呢? 有两种方法,假设应用名称为:webtest 方法1:code:priv_dir(webtest). 方法2:code:lib_dir(webtest, priv). 结果: ([email protected])2> code:priv_dir(webtest). "/data/webtest/_rel/webtest_release/lib/webtest-0.1.0/priv" ([email protected])3> c原创 2020-07-12 20:20:58 · 359 阅读 · 0 评论 -
Can‘t resolve the priv_dir of application webtest_app
([email protected])1> =CRASH REPORT==== 12-Jul-2020::13:04:42.355875 === crasher: initial call: cowboy_stream_h:request_process/3 pid: <0.480.0> registered_name: [] exception error: bad argument: "Can't resolve the priv_dir of ap...原创 2020-07-12 13:12:18 · 381 阅读 · 0 评论