[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to delete a file??



Steve Baker wrote:

> Under some UNIX'en (eg Linux with libc5), it's just a synonym for
> unlink - created (presumably) by someone who thought 'unlink' was
> an illogical name for a delete function.
> 
> Under glibc/libc6, it's a dumb wrapper that calls 'unlink' for files
> and 'rmdir' for directories.
> 
> I don't think you should use 'remove' because it's not portable.

According to remove(3):

CONFORMING TO
       ANSI C, SVID, AT&T, POSIX, X/OPEN, BSD 4.3

Seems to be part of stdio (it is in stdio.h), so it looks quite okay to
use to me. The man page does mention it was a simple alias to unlink in
previous Linux libcs, but those were notoriously non-standard and
incompatible.

-- 
Pierre Phaneuf
http://ludusdesign.com/