HOw do i delete certain file types

This is a discussion on HOw do i delete certain file types within the C++ Programming forums, part of the General Programming Boards category; Can someone tell me how to delete all like .txt files in a folder in all .c files please and ...

  1. #1
    Registered User
    Join Date
    Jan 2002
    Posts
    69

    HOw do i delete certain file types

    Can someone tell me how to delete all like .txt files in a folder in all .c files please and which header it needs.

  2. #2
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,831
    Probably OS dependent. The DeleteFile() API function in Windows will not accept wildcards, maybe some other OS's have an API function that does.

    On a Windows system, log the files one at a time with the FindFirstFile() and FindNextFile() API functions, (which DO accept wildcards), and delete them as you go.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C Delete opened file
    By gidion in forum C Programming
    Replies: 25
    Last Post: 12-04-2008, 09:35 AM
  2. The best way to delete a record from a file?
    By salvadoravi in forum C Programming
    Replies: 25
    Last Post: 01-28-2008, 12:12 PM
  3. Inventory records
    By jsbeckton in forum C Programming
    Replies: 23
    Last Post: 06-28-2007, 04:14 AM
  4. Encryption program
    By zeiffelz in forum C Programming
    Replies: 1
    Last Post: 06-15-2005, 03:39 AM
  5. memory management...
    By master5001 in forum Game Programming
    Replies: 24
    Last Post: 01-07-2002, 04:50 PM

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