Re: deleting files question

From: Mike Wahler (
Date: 06/30/04

Date: Wed, 30 Jun 2004 16:36:20 GMT

"Sonoman" <> wrote in message
> Hi all:
> I would like to find out how to write a small program that deletes files.
> want to be able to delete all files in a directory (i.e. cookies, temp
> files, etc.) regardless of type and name, or may be by extension. This way
> could have it run on start up and I will have my computer free of junk
> time I reboot. What should I use? Please advise.

The C and C++ languages do proved a way to delete a file,
given it's 'full name' (e.g. a 'full path'). See function
'remove()', declared by <stdio.h>.

However, neither language has facilities for working with
'directories' or 'wildcarded' file names. (The languages
don't require the existence of a 'directory structure'
in a file system.)

Most implementations for systems with 'directories' do
provide extensions to the standard library for such
things. The functions typically have names similar
to 'find_first', 'find_next', etc. Consult your documentation
or ask in a newsgroup dedicated to your compiler and/or