Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does "Directory.Delete( "path", false )" do?

Tags:

.net

According to the doucmentation for "Directory.Delete( "path", true )", it remove directories, subdirectories, and files in the path.

What does Directory.Delete( "path", false ) do? According to the doucmentation it does "otherwise".

I mean how can you delete a directory without removing the directory, subdirectories, and files?


1 Answers

Bill James is correct. According to MSDN, if the recursive parameter is false and the directory is not empty, IOException will be thrown.

like image 163
Josh Lee Avatar answered Apr 10 '26 21:04

Josh Lee



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!