Deleting Folders

This is a discussion on Deleting Folders within the C++ Programming forums, part of the General Programming Boards category; How do I delete a folder?...

  1. #1
    Registered User
    Join Date
    Feb 2002
    Posts
    145

    Deleting Folders

    How do I delete a folder?

  2. #2
    Registered User Dual-Catfish's Avatar
    Join Date
    Sep 2001
    Posts
    802

    It's not nice, but its system provides easily file/folder manipulation

    system("rmdir directoryname");

  3. #3
    Registered User Dual-Catfish's Avatar
    Join Date
    Sep 2001
    Posts
    802

  4. #4
    Registered User
    Join Date
    Feb 2002
    Posts
    145

    Thanks...but...

    Okay, that is good if there is nothing in the folder. But what if there is stuff in the folder? Do I have to delete that all and then the folder? Or is there a way just to delete the folder, even if it isn't empty?

    Kyoto
    Last edited by Kyoto Oshiro; 03-31-2002 at 10:34 AM.

  5. #5
    Programming is fun, mkay?
    Join Date
    Oct 2001
    Posts
    490

    Lightbulb You can use...

    If there are no sub-folders, then #include <windows.h> and use FindFirstFile(); and FindNextFile();

  6. #6
    Registered User
    Join Date
    Feb 2002
    Posts
    145
    Isn't there a way to just delete a folder, and everything in it? I don't want to have to delete every single file then the folder, because what if there are 100 files? Any ideas on how to do this?

    Kyoto

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Error while trying to list folders
    By Hellbinder in forum Networking/Device Communication
    Replies: 5
    Last Post: 06-12-2009, 05:27 PM
  2. Deleting folders and sub folders
    By Boomba in forum C++ Programming
    Replies: 30
    Last Post: 06-11-2003, 11:58 AM
  3. Deleting entire folders
    By SirDavidGuy in forum C++ Programming
    Replies: 10
    Last Post: 03-02-2002, 09:54 PM
  4. Deleting folders with everything in the directoy
    By knight543 in forum C++ Programming
    Replies: 1
    Last Post: 02-26-2002, 07:45 PM
  5. Replies: 12
    Last Post: 01-23-2002, 06:56 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21