OverwriteTarget

OverwriteTarget

is an option for functions like CopyFile that specifies whether to overwrite if target files already exist.

Details

  • Typical settings include:
  • Automaticautomatic settings
    Falseoperation fails if it needs to overwrite existing content
    Trueoverwrite existing content

Examples

Basic Examples  (1)

Create a file:

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

Copy the file to a new location:

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

Copying the file back fails with OverwriteTarget->False:

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

Use OverwriteTarget->True to overwrite the existing file:

In[4]:=
Click for copyable input
Out[4]=
Introduced in 2016
(11.0)