Erlang 文件 copy 方法 - Erlang教程

由网友 大卫 发布 阅读 11

Erlang 文件 copy 方法 - Erlang教程

Erlang 文件

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

语法

copy(source,destination)

参数

  • Source −需要复制的源文件名。

  • Destination −文件的目标路径和名称。

返回值

None

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

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

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

Erlang 文件

Erlang 文件 delete 方法 Erlang 原子 binary_to_atom 方法