美文网首页
erlang-在shell中改变当前工作路径

erlang-在shell中改变当前工作路径

作者: Chasel_H | 来源:发表于2018-12-25 14:17 被阅读0次

    初学erlang时,我们经常都需要先用文本编辑器等编写一个类似于file_name.erl源文件,通过在shell中编译它生成了file_name.beam文件后才可以通过file_name:funtion_name().执行此模块内的函数。

    例子如下:

    test.erl test.erl文件所在位置

    用pwd().获取当前shell的工作路径,若想编译erlang文件只有两种办法,一是把erl文件保存当当前工作路径下,不然就是用cd(path).改变当前shell的工作路径,否则的话就会出现 no such file or directory 的错误

    path 注意是方向往右的斜杠"/"  , 不是方向往左的"\"  。

    相关文章

      网友评论

          本文标题:erlang-在shell中改变当前工作路径

          本文链接:https://www.haomeiwen.com/subject/tykflqtx.html