From: Peter Dintelmann Date: Wed, 22 Nov 2006 17:41:55 +0000 (+0100) Subject: POSIX::remove() and directories X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b775e6bae012223b0a5cf674d4a41f12f635fb75;p=p5sagit%2Fp5-mst-13.2.git POSIX::remove() and directories From: "Dintelmann, Peter" Message-ID: <3852726AFA94DE4F87E616F13F416A5F0A912F@naimucu1.ffz00k.rootdom.net> p4raw-id: //depot/perl@29353 --- diff --git a/ext/POSIX/POSIX.pm b/ext/POSIX/POSIX.pm index a67f883..617d999 100644 --- a/ext/POSIX/POSIX.pm +++ b/ext/POSIX/POSIX.pm @@ -421,7 +421,7 @@ sub puts { sub remove { usage "remove(filename)" if @_ != 1; - CORE::unlink($_[0]); + (-d $_[0]) ? CORE::rmdir($_[0]) : CORE::unlink($_[0]); } sub rename {