*BSD News Article 67575


Return to BSD News archive

Newsgroups: comp.unix.misc,comp.unix.bsd.misc
Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.uwa.edu.au!DIALix!metapro!bernie
From: bernie@metapro.DIALix.oz.au (Bernd Felsche)
Subject: Re: How to delete files within C programs
Message-ID: <DqtGyn.K6o@metapro.DIALix.oz.au>
Organization: MetaPro Systems, Perth, Western Australia
References: <Oum-El-Kheir.Benkahla-3004961724540001@mac-ugm-3.imag.fr> <4m5p3k$3nq@dfw-ixnews2.ix.netcom.com> <4m7sr3$rf9@news.rhrz.uni-bonn.de> <DqtDDy.Hrq@metapro.DIALix.oz.au>
Date: Fri, 3 May 1996 06:35:11 GMT
Lines: 26
Xref: euryale.cc.adfa.oz.au comp.unix.misc:22386 comp.unix.bsd.misc:899

Following up to myself beause I make mistakes too...
In <DqtDDy.Hrq@metapro.DIALix.oz.au>
  bernie@metapro.DIALix.oz.au (Bernd Felsche) writes:

>In <4m7sr3$rf9@news.rhrz.uni-bonn.de>
>  juengst@saph1.physik.uni-bonn.de (Henry G. Juengst) writes:

>>In article <4m5p3k$3nq@dfw-ixnews2.ix.netcom.com>, SolutionWorks <solwork@popd.ix.netcom.com> writes:
>>>Very simple solution, use the 'unlink' system function to delete files

>>This might be a simple solution if you know the solution, but why should
>>a beginner know that the function to delete a file is not something like
>>'delete_file', but 'unlink' in the unix mud ? 

>Nothing stops you from defining delete_file to be like unlink if you
>prefer the larger amount of typing. unlink() won't actually delete the
>file .. it removes one link from the inode and the corresponding
>directory entry [ coincidentally, the space allocated to the inode is
>released when the link count goes to zero ]. So delete_file is a
                              and the open count
>misnomer in that sense.
-- 
Bernd Felsche {speaking for himself}
MetaPro Systems Pty Ltd, 130 Fauntleroy Avenue,
Redcliffe, Western Australia 6104
Phone: +61 9 479 3722    Fax: +61 9 479 3720