--- lib/File/Remove.pm 2004-12-04 16:34:48.000000000 -0800 +++ /Users/pudge/Remove.pm 2005-07-12 15:57:19.000000000 -0700 @@ -106,6 +106,8 @@ $VERSION = '0.29'; +our $glue; + sub expand (@) { my @args; @@ -176,13 +178,14 @@ $unlink = \&Win32::FileOp::Recycle; $rmdir = \&Win32::FileOp::Recycle; } elsif ($^O eq 'darwin') { - our $f; - eval 'use Mac::Glue ();'; - die "Can't load Mac::Glue::Finder to support the Trash Can: \$@ = $@" if length $@; + unless ($glue) { + eval 'use Mac::Glue ();'; + die "Can't load Mac::Glue::Finder to support the Trash Can: \$@ = $@" if length $@; + $glue = Mac::Glue->new('Finder'); + } my $code = sub { - my $f = Mac::Glue->new("Finder"); - my @files = map { s{^:}{}; $_ } map { s{/}{:}g; $_ } map { File::Spec->rel2abs($_) } @_; - $f->delete(@files); + my @files = map { Mac::Glue::param_type(Mac::Glue::typeAlias() => $_) } @_; + $glue->delete(\@files); }; $unlink = $code; $rmdir = $code; --- t/1_directories.t 2004-12-04 16:34:18.000000000 -0800 +++ /Users/pudge/1_directories.t 2005-07-12 15:57:22.000000000 -0700 @@ -29,6 +29,7 @@ "!-e: $path"; ok mkdir($path), "mkdir: $path"; +chmod 0777, $path; ok -e $path, "-e: $path"; } @@ -47,6 +48,7 @@ "!-e: $path"; ok mkdir($path), "mkdir: $path"; +chmod 0777, $path; ok -e $path, "-e: $path"; } @@ -65,6 +67,7 @@ "!-e: $path"; ok mkdir($path), "mkdir: $path"; +chmod 0777, $path; ok -e $path, "-e: $path"; } @@ -106,6 +109,7 @@ "!-e: $path"; ok mkdir($path), "mkdir: $path"; +chmod 0777, $path; ok -e $path, "-e: $path"; } @@ -137,6 +141,7 @@ "!-e: $path"; ok mkdir($path), "mkdir: $path"; +chmod 0777, $path; ok -e $path, "-e: $path"; } @@ -166,6 +171,7 @@ "!-e: $path"; ok mkdir($path), "mkdir: $path"; +chmod 0777, $path; ok -e $path, "-e: $path"; }