Thread: HOw do i delete certain file types

  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,829
    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, 10: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, 01: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, 05:50 PM