Re: deleting files question

From: Mike Wahler (mkwahler_at_mkwahler.net)
Date: 06/30/04


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


"Sonoman" <nospam@microsoft.com> wrote in message
news:s9idnTpiwLokQX_dRVn-tw@comcast.com...
> Hi all:
> I would like to find out how to write a small program that deletes files.
I
> 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
I
> could have it run on start up and I will have my computer free of junk
every
> 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
OS.

-Mike



Relevant Pages

  • Re: more idle thinking: SiMPL
    ... I am thinking of an odd piece of syntax: ... by extension: ... treatment of ';' could be a little more flexible than in C family languages, ... likely make an unreasonable headache for the compiler (AKA: ...
    (comp.lang.misc)
  • Re: Basic Explaination of OO in Ada
    ... coming from C and Java and other "modern" ... Because "OO" became a synonym for "good", and early examples of OO were shown in languages that supported programming by extension, programming by extension got called OOP, but that is a misnomer. ...
    (comp.lang.ada)
  • Re: Void question
    ... exceptionally powerful in VB and all thats needed is a simple extension of ... Languages that provide such a ... major changes both to the C standard and to typical C implementations, ...
    (comp.lang.c)
  • Re: Seeking dynamic extension languages information
    ... > permit dynamic extension of the programming language grammar. ... > I am making a list of programming languages that ...
    (comp.lang.java.help)
  • Re: Seeking dynamic extension languages information
    ... > permit dynamic extension of the programming language grammar. ... > I am making a list of programming languages that ...
    (comp.programming)