Thread: Emptying the contetns of a folder.

  1. #1
    Registered User
    Join Date
    Aug 2005
    Posts
    8

    Emptying the contetns of a folder.

    How can I do that?
    Please and thanks.

  2. #2
    Registered User Queatrix's Avatar
    Join Date
    Apr 2005
    Posts
    1,342
    Try deleting the directory, then recreating it.

  3. #3
    Registered User
    Join Date
    Aug 2005
    Posts
    8
    ??
    The predefined functions can only delete empty folders to my knowlege.

  4. #4
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    Look up SHFileOperation. You'll want to use FO_DELETE with a pFrom something like "C:\\files\\*\0"

  5. #5
    Registered User
    Join Date
    Aug 2005
    Posts
    8
    thanks, but like how do I delete the subdirectorys with out deleting the current dir?

    SHFILEOPSTRUCT fop;
    fop.hwnd = hwnd;
    fop.wFunc = FO_DELETE;
    fop.pFrom = szpathint;
    fop.pTo = NULL;
    fop.fFlags = FOF_ALLOWUNDO | FOF_FILES || FOF_NOCONFIRMATION;

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Reading .dat files from a folder in current directory...
    By porsche911nfs in forum C++ Programming
    Replies: 7
    Last Post: 04-04-2009, 09:52 PM
  2. accessing all files in a folder.
    By pastitprogram in forum C++ Programming
    Replies: 15
    Last Post: 04-30-2008, 10:56 AM
  3. Not able to access directory of home folder
    By Bargi in forum Linux Programming
    Replies: 1
    Last Post: 02-06-2008, 02:45 AM
  4. read only folder on Windows
    By George2 in forum Windows Programming
    Replies: 2
    Last Post: 11-05-2007, 09:18 AM
  5. Hiding a folder
    By nextstep in forum Windows Programming
    Replies: 16
    Last Post: 03-20-2005, 03:07 PM