Erlang – copy

Erlang copy

In this guide, we will discuss Erlang copy. This method is used to make a copy of an existing file.

Syntax

copy(source,destination)

Parameters

  • Source − The name of the source file which needs to be copied.
  • Destination − The destination path and name of the file.

Return Value

None

For example

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

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

Output

A file called Duplicate.txt will be created in the same location as the Newfile.txt and it will have the same contents as Newfile.txt.

Next Topic : Click Here

This Post Has 2 Comments

Leave a Reply