This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)
BUILT-IN MATHEMATICA SYMBOL|See Also »

DeleteContents

DeleteContents
is an option for DeleteDirectory that specifies whether the contents of directories should automatically be deleted.
Copy a directory:
List of files in the directory:
The contents of the directory cannot be deleted:
Use DeleteContents->True to automatically delete the contents:
The directory is no longer there:
Copy a directory:
In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
In[3]:=
Click for copyable input
Out[3]=
List of files in the directory:
In[4]:=
Click for copyable input
Out[4]=
The contents of the directory cannot be deleted:
In[5]:=
Click for copyable input
Out[5]=
Use DeleteContents->True to automatically delete the contents:
In[6]:=
Click for copyable input
The directory is no longer there:
In[7]:=
Click for copyable input
Out[7]=
New in 2