This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Reverting mknod


According to Michael Ambrus on 4/23/2007 7:06 AM:
> What does the standard say should be the opposite of mknod?
> 
> Or in other words: how do I remove a file of any type?

remove() will delete any file type (by either calling unlink or rmdir as
appropriate).

> 
> I thought it would be unlink, but I'm not certain and the info at
> opengroup doesn't seem to support it.

Actually, according to opengroup, unlink is required to work on all file
types except directories, and on some implementations, it even works on
directories (although with superuser privileges, and even then you
shouldn't normally do that, as it can lead to filesystem corruption).

-- 
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9@byu.net

Attachment: signature.asc
Description: OpenPGP digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]