This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
POSIX::remove() and directories
authorPeter Dintelmann <Peter.Dintelmann@Dresdner-Bank.com>
Wed, 22 Nov 2006 17:41:55 +0000 (18:41 +0100)
committerSteve Peters <steve@fisharerojo.org>
Wed, 22 Nov 2006 17:00:54 +0000 (17:00 +0000)
From: "Dintelmann, Peter" <Peter.Dintelmann@Dresdner-Bank.com>
Message-ID: <3852726AFA94DE4F87E616F13F416A5F0A912F@naimucu1.ffz00k.rootdom.net>

p4raw-id: //depot/perl@29353

ext/POSIX/POSIX.pm

index a67f883..617d999 100644 (file)
@@ -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 {