English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
This method is used to copy an existing file.
copy(source,destination)
Source −The source filename to be copied.
Destination −The target path and name of the file.
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.