Path: utzoo!attcan!uunet!lll-winken!uwm.edu!wuarchive!kuhub.cc.ukans.edu!markv From: markv@kuhub.cc.ukans.edu Newsgroups: comp.sys.amiga.tech Subject: Re: Deleting files from within C ? Message-ID: <24614.26651251@kuhub.cc.ukans.edu> Date: 31 May 90 17:47:12 GMT References: <2136.265c6de6@csc.anu.oz> Organization: University of Kansas Academic Computing Services Lines: 26 > 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 ... 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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~