Removing non-empty directory

This is a discussion on Removing non-empty directory within the C Programming forums, part of the General Programming Boards category; Hello everyone, I am wondering how to remove a non-empty directory on Windows? I find that function RemoveDirectory works only ...

  1. #1
    Registered User
    Join Date
    May 2006
    Posts
    1,579

    Removing non-empty directory

    Hello everyone,


    I am wondering how to remove a non-empty directory on Windows? I find that function RemoveDirectory works only for empty directory.


    thanks in advance,
    George

  2. #2
    Fear the Reaper...
    Join Date
    Aug 2005
    Location
    Toronto, Ontario, Canada
    Posts
    625
    You could remove all the files from the directory, then use RemoveDirectory.
    Teacher: "You connect with Internet Explorer, but what is your browser? You know, Yahoo, Webcrawler...?" It's great to see the educational system moving in the right direction

  3. #3
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    Recursively remove all files from the directory, deleting each directory as you do. Look at recursive functions if you have not used them before.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help with binary file c++
    By lucky_mutani in forum C++ Programming
    Replies: 4
    Last Post: 06-05-2009, 09:24 AM
  2. Profiler Valgrind
    By afflictedd2 in forum C++ Programming
    Replies: 4
    Last Post: 07-18-2008, 09:38 AM
  3. Couple errors please help :-D
    By JJJIrish05 in forum C Programming
    Replies: 9
    Last Post: 03-06-2008, 01:54 AM
  4. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  5. Directory reading trouble
    By samGwilliam in forum Linux Programming
    Replies: 0
    Last Post: 03-10-2002, 08:43 AM

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