Thread: how to delete all files in a directory?

  1. #1
    Registered User
    Join Date
    Nov 2002

    how to delete all files in a directory?

    i would like to delete all files in a directory, is there any function can help with this?

    thank you for helping~~

  2. #2
    Magically delicious LuckY's Avatar
    Join Date
    Oct 2001
    Look up findfirst() findnext() and remove()

  3. #3
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Waterloo, Texas
    You might take a look at Salem'sdirectory walker.

    And when removing a directory, remember to delete all of the files within it before attempting to remove the directory itself (if there are subdirectories, these of course must be deleted before the parent is).
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
        return std::pow
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Listing specific files in a directory
    By knirirr in forum C Programming
    Replies: 14
    Last Post: 01-29-2008, 05:42 AM
  2. Finding files in a directory
    By smarta_982002 in forum C Programming
    Replies: 1
    Last Post: 01-25-2008, 10:10 AM
  3. added start menu crashes game
    By avgprogamerjoe in forum Game Programming
    Replies: 6
    Last Post: 08-29-2007, 01:30 PM
  4. Delete files that are used
    By Yuri in forum C++ Programming
    Replies: 8
    Last Post: 10-18-2005, 01:48 PM
  5. Batch file programming
    By year2038bug in forum Tech Board
    Replies: 10
    Last Post: 09-05-2005, 03:30 PM