Emptying the contetns of a folder.

This is a discussion on Emptying the contetns of a folder. within the Windows Programming forums, part of the Platform Specific Boards category; How can I do that? Please and thanks....

  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, 10:52 PM
  2. accessing all files in a folder.
    By pastitprogram in forum C++ Programming
    Replies: 15
    Last Post: 04-30-2008, 11: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

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