[comp.sys.amiga.tech] Deleting files from within C ?

markv@kuhub.cc.ukans.edu (06/01/90)

> Markus> How does one delete files on (say) the RAM: disc from *within*
> Markus> a C program?  I'm just starting to learn C, and I've set
> Markus> myself a project that would make use of this.  I want to
> Markus> create temporary work files, and clean up when I finish. It
> Markus> *is* possible, right?
> 
> Certainly.  The function you're looking for is DeleteFile(), in the
> dos.library.  It takes a single parameter, the (C-style) string
> containing the name of the file you want to delete.  It returns an
> error if the deletion fails.

What's wrong with ANSI C?  How about...

	#include <stdio.h>
	...
	remove("RAM:foofile");
 
-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Mark Gooderum			Only...		\    Good Cheer !!!
Academic Computing Services	       ///	  \___________________________
University of Kansas		     ///  /|         __    _
Bix:	  markgood	      \\\  ///  /__| |\/| | | _   /_\  makes it
Bitnet:   MARKV@UKANVAX		\/\/  /    | |  | | |__| /   \ possible...
Internet: markv@kuhub.cc.ukans.edu
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~