directory class : Delete(bool) method

Description

Removes this directory with the specified operation.

Syntax

directoryInstance.Delete(bool recursive)

Arguments

ClassNameDescription
boolrecursiveA bool value that determine whether to remove children at the same time.

Return value

None

Sample code

1:

directory dir = new directory("c:\somewhere...");

2:

dir.Delete(true); // The dir is removed along with the children.

Notes

It's a wrapper of the System.IO.DirectoryInfo.Delete(Boolean) method.

If the argument is true, the all subdirectories and files in this directory will be removed along with this directory.

If the argument is false, this directory will remove only when it is empty. In other words, this method behaves in the same way as the Delete() method.

Links for reference

Copyright © Cooker All rights reserved.