RenameFile

RenameFile["file1", "file2"]
renames to .

DetailsDetails

  • must already exist; must not.
  • RenameFile sets the modification date for to be the same as for .
  • RenameFile returns the full new file name, or $Failed if the file cannot be renamed.

ExamplesExamplesopen allclose all

Basic Examples (1)Basic Examples (1)

Copy a file:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
In[3]:=
Click for copyable input
Out[3]=

Rename the file:

In[4]:=
Click for copyable input
In[5]:=
Click for copyable input
Out[5]=

Import the renamed file:

In[6]:=
Click for copyable input
Out[6]=

Delete the file:

In[7]:=
Click for copyable input
New in 2
New to Mathematica? Find your learning path »
Have a question? Ask support »