delteing a file...I got it just need help...

This is a discussion on delteing a file...I got it just need help... within the Windows Programming forums, part of the Platform Specific Boards category; As far as I know, there's no such functionality built into the API. But you can generate a list of ...

  1. #16
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    As far as I know, there's no such functionality built into the API. But you can generate a list of possible extensions (*.aaa, *.aab, *.aac, etc.), and delete all except the one you want to keep. Of course, that will probably be horribly inefficient, so you could try a 'cheating' way: Make backup copies of all the files you want to keep, and store them in another folder; then delete all files in the target folder, and move the backups back into the now-empty folder.
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  2. #17
    Registered User
    Join Date
    Aug 2004
    Posts
    731
    dang it! Well ok how do I set more then one flag then? Notin I did worked and I need to use mroe then 1 of em?

  3. #18
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    >> Well ok how do I set more then one flag then? <<

    Use the bitwise or operator.
    Code:
    sfos.fFlags = FOF_ALLOWUNDO | FOF_NOCONFIRMATION;
    >> But I want to be able to exclude a file extension but still be able to use the * for a wild card. <<
    Code:
    // Pseudo code only
    // Delete all files which don't have the .doc extension.
    for (each file in folder)
    {
        if (!PathMatchSpec(file, "*.doc"))
        {
            DeleteFile(file);
        }
    }
    Last edited by anonytmouse; 09-19-2004 at 11:28 AM.

  4. #19
    Registered User
    Join Date
    Aug 2004
    Posts
    731
    well actually I don't need the exclude thing no more because I now know how to use more then 1 flag. Altho it would be nice to exclude files, I don't under stand that code to well.

    Thanks alot tho!

  5. #20
    Registered User
    Join Date
    Aug 2004
    Posts
    731
    Code:
    sfos.fFlags = FOF_ALLOWUNDO & FOF_NOCONFIRMATION;
    didn't work :'(


    Edit: In fact non of your codes worked. :'( :'(
    Last edited by Rune Hunter; 09-19-2004 at 10:39 AM.

  6. #21
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    Quote Originally Posted by Rune Hunter
    Code:
    sfos.fFlags = FOF_ALLOWUNDO & FOF_NOCONFIRMATION;
    didn't work :'(


    Edit: In fact non of your codes worked. :'( :'(

    Sorry, had a "brain mis-fire", you want the bitwise or operator! See original post. The other code is pseudo-code, it aims to demonstrate the concept but will not compile.

  7. #22
    Registered User
    Join Date
    Aug 2004
    Posts
    731
    oh I see... I ain't that good at c++ so... I am going to try some more stuff.

    Thanks.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Encryption program
    By zeiffelz in forum C Programming
    Replies: 1
    Last Post: 06-15-2005, 04:39 AM
  2. Unknown Memory Leak in Init() Function
    By CodeHacker in forum Windows Programming
    Replies: 3
    Last Post: 07-09-2004, 10:54 AM
  3. archive format
    By Nor in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 08-05-2003, 08:01 PM
  4. Making a LIB file from a DEF file for a DLL
    By JMPACS in forum C++ Programming
    Replies: 0
    Last Post: 08-02-2003, 09:19 PM
  5. Need a suggestion on a school project..
    By Screwz Luse in forum C Programming
    Replies: 5
    Last Post: 11-27-2001, 02:58 AM

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