无涯教程-Erlang - copy函数

85 阅读1分钟

此方法用于复制现有文件。

copy - 语法

copy(source,destination)
  • source          -  需要复制的源文件的名称。

  • destination  - 文件的目标路径和名称。

copy - 示例

-module(helloworld).
-export([start/0]). 

start() ->
file
:copy("Newfile.txt","Duplicate.txt").

将在与 Newfile.txt 相同的位置创建一个名为 Duplicate.txt 的文件,该文件的内容与Newfile.txt相同。

参考链接

www.learnfk.com/erlang/erla…