*BSD News Article 67421


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.mira.net.au!inquo!in-news.erinet.com!imci5!pull-feed.internetmci.com!news.internetMCI.com!newsfeed.internetmci.com!swrinde!howland.reston.ans.net!math.ohio-state.edu!jussieu.fr!univ-lyon1.fr!news.imag.fr!mac-ugm-3.imag.fr!user
From: Oum-El-Kheir.Benkahla@imag.fr (Oum-El-Kheir Benkahla)
Newsgroups: comp.unix.misc,comp.unix.bsd.misc
Subject: How to delete files within C programs
Date: Tue, 30 Apr 1996 17:24:54 +0200
Organization: LGI-IMAG
Lines: 15
Message-ID: <Oum-El-Kheir.Benkahla-3004961724540001@mac-ugm-3.imag.fr>
NNTP-Posting-Host: mac-ugm-3.imag.fr
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
Xref: euryale.cc.adfa.oz.au comp.unix.misc:22315 comp.unix.bsd.misc:877

   I am searching a way for deleting files within C programs. I tried the
exec command for executing rm (execlp("rm", "rm", "myfile", 0), which
indeed deletes myfile but the problem here is that the exec command
doesn't return on success. 
   Is there another way to do this and return to the calling process ?

    Thank you in advance.

OB

-- 
Oum-El-Kheir BENKAHLA
LGI_IMAG, 46, Av. Félix Viallet, 38031 Grenoble Cedex 01
Tel. : 76.57.48.19
Fax : 76.57.47.17