Thread (13 messages) flat view 13 messages, 4 authors, 2016-06-15

Re: [PATCH] Do _not_ call unlink on a directory

From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2016-06-15 22:43:21


On Mon, 16 Jul 2007, Thomas Glanzmann wrote:
Hello,
quoted
quoted
is there a reason why we call unlink and not remove?
quoted
Exactly because we only want to remove _files_.
of course. That is the whole point. Call unlink for files, rmdir for
directories.
No, but we don't *want* the "rmdir for directories" part! 

That's the whole point.

Calling "remove()" would be *wrong*. We want the *sane* "unlink()" 
behaviour, where it only removes files, and returns an error for 
directories.

		Linus
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help