From: Scott Lamb Date: Mon, 16 Jul 2007 21:23:32 GMT Subject: Re: [PATCH] Do _not_ call unlink on a directory Message-ID: <469BE1D4.1070408@slamb.org> In-Reply-To: Linus Torvalds wrote: > 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. Of course, but when used immediately after stat() says the path does not refer to a directory, I would prefer SUS remove() (rmdir() for directories) to Solaris unlink() (break_filesystem() on directories). But Solaris remove() is broken, too, so it's a moot point. The post-patch behavior is good enough - as you said, it won't happen during reasonable usage and the problem's not unique to git. Best regards, Scott -- Scott Lamb