English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Erlang File copy Method

Erlang Files

This method is used to copy an existing file.

Syntax

copy(source,destination)

Parameters

  • Source −The source filename to be copied.

  • Destination −The target path and name of the file.

Return Value

None

-module(helloworld).
-export([start/0]). 
start() ->   
   file:copy("Newfile.txt","Duplicate.txt").

A file named Duplicate.txt will be created in the same location as Newfile.txt, and it will have the same content as Newfile.txt.

Erlang Files