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

Erlang File rename Method

Files in Erlang

This method is used to rename an existing file.

Syntax

rename(oldfilename,newfilename)

Parameters

  • oldfilename −This is the original filename.

  • newfilename −This is the name the file should be renamed to.

Return Value

Status of the rename operation. If successful, a message will be displayed {Ok} Message.

-module(helloworld). 
-export([start/0]). 
start() ->
   io:fwrite("~p~n",[file:rename("Newfile.txt","Renamedfile.txt")]).

FileNewfile.txtWill be renamed to Renamedfile.txt.

Files in Erlang