Directory.Delete has poor MSDN documentation (IMO) and a confusing "recursive As Boolean" second parameter

Hello,
The MSDN explanation is:
"Deletes the specified directory and, if indicated, any subdirectories and files in the directory."
If you specify that a directory should be deleted, the logical assumption is that subfolders and files will also be deleted. How can you delete a directory without all of its recursive contents also being deleted!? The documentation does not explain why
you need the Boolean parameter.
I have tested the function out, and I cannot understand the results it is producing. Can someone clarify precisely what this function actually does?
Also, is there another function that simply delete the directory whether or not it has any contents?
Many thanks.
Keith
R K Howard

I tested what I communicated to you with another developer, and we both observed the behaviour. I will re-test soon (I can't do it immediately) and re-post later on.
Thanks.
R K Howard
Perhaps but you don't specify what you were doing when the behavior occured. I would guess something else had a folder open for one of the folders you were attempting this with. Or perhaps a file open and locked in the initial folder or subfolders off the
initial folder.
Doesn't any process on a PC have to ask the OS if it can "open" a file or folder or delete either so the OS knows what to do when those things occur including if something else has that file or folder open? After all the program doesn't delete
anything. It tells the OS it wants something deleted and the OS performs the deletion doesn't it? Otherwise the MFT could not keep track of anything on the system could it?
I replicated the issue as
Rbie said by having explorer displaying one of the folders to be deleted.
I have code that will display if a folder is open in Explorer if you would like that.
Also with regard to the Boolean value that will keep any subfolders in a chain from the initial folder in the path as well as the initial folder from being deleted if a subfolder contains a file if it is set to false. I suppose all other subfolders not in
that direct chain but in other subfolders in the initial folder would be deleted up to their entire chain except the original folder in the path if they all were empty.
Obviously if the boolean is set to true it will allow all folders in the initial folder, and all their chains, to be deleted as well as the initial folder even if they contain files. However there could be security issues that occur if a user used that code
on a path chain where they had no delete authority somewhere along the line of the chain.
Tree with branches rather than chain really.
La vida loca

Similar Messages

  • How to repair my macbook pro when i had delete the app store file and know it telling that appstore file has been damage or incomplete and i had the version 10.6.8

    how to repair my macbook pro when i had delete the app store file and know it telling that appstore file has been damage or incomplete and i had the version 10.6.8

    so is their is any way that i can solve this matter

  • I have tow itunes libraries.  Music from one library has merged with the other and I can not delete the songs.  They keep coming back.

    I have two ipod touch libraries under my account.  One for my daughter and one for me.  I bought my daughter an Iphone and then opened her ipod touch libraryon the computer (Windows Vista).  I plugged in her iphone so that she can have the stuff from her ipod touch on her new phone.  Somehow her library has partially merged with my library.  My ipod touch now has some of HER games and music on it.  I went into my library and deleted these games and songs, but they keep coming back.  How do I get rid of these once and for all.  I don't want to be shuffling AC/DC, Rob Zombie, and then get Justin Bieber all of a sudden while sitting at a red light in traffic.

    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Unsync all music and resync
    - Restore from backup. See:                                 
    iOS: How to back up           
    - Restore to factory settings/new iOS device.

  • HT204053 How do I delete an iCloud ID that has an old email address and I can't remember the password?

    How do I delete and iCloud account that has a former email address and I can't remember the password.  All attempts to recover the password have failed!!

    Hello there, Gary7023.
    The following Knowledge Base article made prove useful for you with the issue you're having:
    iOS 7: If you're asked for the password to your previous Apple ID when signing out of iCloud
    http://support.apple.com/kb/TS5223
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro D.

  • I recently got a new laptop, it has no music on it and I have been plugging my iPod in and listening to music that way. Tonight it decided to sync with my iTunes and deleted all of my music. Is there any way I can get my music back?

    I recently got a new laptop, it has no music on it and I have been plugging my iPod in and listening to music that way. Tonight it decided to sync with my iTunes and deleted all of my music. Is there any way I can get my music back?

    See:
    Syncing to a "New" Computer or replacing a "crashed" Hard Drive: Apple Support Communities
    Sync Your iOS Device with a New Computer Without Losing Data - How-To Geek
    Recovering your iTunes library from your iPod or iOS device: Apple Support Communities

  • HT201272 I have deleted a song from my library and want to re-download it.  When I access my purchased items in the iTunes store, the song has the 'purchased' button next to it and won't let me re-download. Any suggestions for things to try?

    I have deleted a song from my library and want to re-download it.  When I access my purchased items in the iTunes store, the song has the 'purchased' button next to it and won't let me re-download. Any suggestions for things to try?

    While you can redownload most past purchases without charge, you can't redownload movies without paying again.  See Downloading past purchases from the App Store, iBookstore, and iTunes Store: http://support.apple.com/kb/HT2519

  • HT1657 my rental has reported a download error and cannot be downloaded or deleted - any suggestions?

    my rental has reported a download error and cannot be downloaded or deleted - any suggestions on how to fix it one way or another?

    Hello there, asim01.
    The following Knowledge Base articles offer a few pointers with troubleshooting issues with downloads from iTunes. First thing to try is verifying connectivity to the iTunes Store:
    Can't connect to the iTunes Store
    http://support.apple.com/kb/ts1368
    If the issue is related to an interrupted download:
    iTunes: How to resume interrupted iTunes Store downloads
    http://support.apple.com/kb/ht1725
    Ultimately, if you are still unable to download your purchase, feel free to report the issue using the following information:
    How to report an issue with your iTunes Store, App Store, Mac App Store, or iBooks Store purchase
    http://support.apple.com/kb/ht1933
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

  • I accidentally deleted Candy Crush off my phone, and when I went to reinstall it, it reinstalled but has now disappeared from my screen.  I went to the app store and it says there that it is still installed.  How do I get it back?

    I accidentally deleted Candy Crush off my phone, and when I went to reinstall it, it reinstalled but has now disappeared from my screen.  I went to the app store and it says there that it is still installed.  How do I get it back?

    You may have accidentally put it in a folder instead of deleting it. Check all your folders to see if it is in one.

  • SonyAVCHD video looks great in iMovie11 or iDVD7.1.2. When I burn a DVD it's terrible. If I freeze frame I see squares. The picture has poor contrast. I've viewed DVD on my 6-year-old, 24 in. intel 2.16 GHz iMac, and on TV. Help!

    I just bought a very good quality Sony AVCHD camcorder. I also just upgraded my computer from Tiger to Snow Leapord. My iMac is a 6-year-old, 2.16GHz Intel 2 Duo, with a 24 inch screen and 3GB Ram.
    My Sony camcorder HD video looks great in iMovie11 and in iDVD7.1.2., but when I burn a DVD "professional" it looks terrible. If I look at a freeze frame on the DVD I see image made-up of squares. The picture has poor contrast. It looks as bad as poor quality VHS. Do I need to get a new iMac to make this work? Is it possible to make a sharp, clear DVD from AVCHD footage with a 6-year-old iMac like mine?

    That thread helped for a time.  But now it seems as though my computer is back to slow again.  But, some of the jargon is over my head as well.  Not sure I knew quoite everything they were talking about.  But thanks a lot for that, it helped I probably just need to reread it and follow the instructions again.  Thanks so much.

  • HT4859 I keep getting a MSG that my device has not been backed up. Going thru manage iCloud I see ther are two backs (one for cell and iPad). They both say "incomplete ". If I delete them cloud backups will stop and I assume I will need to go back to the

    I keep getting a MSG that my device has not been backed up. Going thru manage iCloud I see ther are two backs (one for cell and iPad). They both say "incomplete ". If I delete them cloud backups will stop and I assume I will need to go back to the control.
    Has anyone else experienced this?

    After deleting the backups, go back to Settings>iCloud>Storage & Backup and make sure iCloud Backup is set to On (if not, turn it on).

  • I have two e-mail addresses and on the left hand side in mail if i expand the sent box one account has an exclamation mark appeared and some mail has deleted it's self??

    I have two e-mail addresses and on the left hand side in mail if i expand the sent box one account has an exclamation mark appeared and some mail has deleted it's self??

    You can continue to use them as Apple ID's, change the rescue address (as you know)
    You can use your iCloud address, but it won't be an alias, it's a full email address.

  • I deleted all my emails from inbox and trash, but the mail "file" has 2GB. How can I permantely delete this information from my iphone4?

    How can I permantely delete email information from my iphone4?
    I deleted all my emails from inbox and trash, but the Mail "file" still has 2GB...

    Does anyone have an answer to this problem? It's been 4 or 5 days now and iCloud still says I have 0kb of 5GB available, and 6.1GB of mail on iCloud. I guess that's better than yesterday when it said I had 8.3GB of mail. Does anyone know if it simply takes Apple a week to actually empty a mailbox?
    thanks in advance, hopefully tomorrow it says I have only 4GB of non-existent mail and I can start using it again...

  • I bought new iphone on 25th October and it has poor network coverage and some times it loose connection . Is is normal???

    Hi,
    My newly purchased Iphone 5s(space grey) has poor network strength. I am using airtel carrier. Sometimes it lost the coverage of network.And very fluctuating network. If I use same card in any other phones like sony,nokia etc I have full network coverage. Is it normal???

    Hello mayankfromvadodara,
    After reviewing your post, I have located an article that can help with cellular network issues. It contains a number of troubleshooting steps and helpful advice for the issue you are experiencing:
    iPhone cellular data connection issues - Apple Support
    Cellular data issues can include:
    No connection over cellular network, but works over Wi-Fi
    Unable to load pages in Safari
    Unable to use email over cellular
    Slow data connection over cellular
    Intermittent cellular data connection
    Unable to join 3G/4G/LTE network
    "Unable to activate cellular data connection" alert message
    Resolution
    Follow these steps for help with cellular data issues on your iPhone. After performing each step, test to see if your iPhone still has the issue.
    Toggle airplane mode: Tap Settings, turn airplane mode on, wait three seconds, and then turn off again.
    Restart your iPhone.
    Make sure that your software is up to date:
    Check for a Carrier Settings Update: Tap Settings > General > About.
    Check for an iOS Software Update: Tap Settings > General > Software Update.
    Some updates may require a Wi-Fi connection.
    Remove the SIM Card and reinsert it. Allow the iPhone to acquire the network again.
    If your SIM card has SIM PIN enabled, try turning it off: Tap Settings > Phone > SIM PIN.
    Try another location. If a different location works, but the original location still doesn't, contact your carrier to report the issue.
    Reset network settings: Tap Settings > General > Reset > Reset Network Settings.
    Resetting network settings on your device will erase all current saved settings, including Wi-Fi passwords, preferred networks, and VPN settings.
    Restore the iPhone as new.
    Contact your carrier to:
    Verify that the iPhone is properly set up on the account with the appropriate, current data plan.
    Verify that there are no account-related blocks.
    Find out if there are specific error messages in the carrier logs that could help determine why the issue is occurring.
    If none of the above steps resolves the issue, contact your carrier, make an appointment at an Apple Retail Store, or contact AppleCare.
    If you are traveling internationally, you may need to turn data roaming on: Tap Settings > Cellular. Check with your carrier first to understand the cost of international data roaming. 
    Thank you for contributing to Apple Support Communities.
    Cheers,
    BobbyD

  • Our Century Link Modem/Router supplied at set up, has poor range. It is in the kitchen ( main level ) and won't reach our studio fully at 30-40ft away. Will setting up my time capsule i the studio improve this signal?

    Our Century Link Modem/Router supplied at set up, has poor range. It is in the kitchen ( main level ) and won't reach our studio fully at 30-40ft away. Will setting up my time capsule in the studio improve this signal? If not, what can I do!???

    Will setting up my time capsule in the studio improve this signal?
    Yes, if the Time Capsule remains connected to your Century Link modem/router using a permanent, wired Ethernet cable connection.
    Any other option will involve the purchase of more hardware.
    One option would be to keep the Time Capsule connected to the modem/router using a short Ethernet cable, and configure the Time Capsule to provide a wireless network.  Add an AirPort Express about half way between the kitchen and the studio to wirelessly extend the signal from the Time Capsule to provide a much stronger signal in the studio.
    Another option might be to use a wireless repeater that is compatible with the modem/router. Century Link might have a solution, or be able to recommend a compatible device for that purpose.

  • Looking for a back up drive for photos and videos that works with time machine, prefer wireless. Time capsule has poor reviews and already have BT hub

    Looking for a back up drive for photos and videos that works with time machine, prefer wireless. Time capsule has poor reviews and already have BT hub that serves as a good router. 3gb or 4gb capacity preferred but 2 would suffice.

    Plug a NAS into the BT Hub that does TM. Look at Synology.
    You just use the wireless of the hub.
    But the cheapest solution is still the TC.

Maybe you are looking for