Skip Menu |

This queue is for tickets about the File-Remove CPAN distribution.

Report information
The Basics
Id: 30251
Status: resolved
Priority: 0/
Queue: File-Remove

People
Owner: Nobody in particular
Requestors: rick.coxy [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: removing dirs enclosed by curly braces
Hi there, I'm using a application which writes out temp directories enclosed in curly braces e.g. /tmp/{6543} The test below hopefully illustrates the problem I'm getting removing these sorts of directories #!/usr bin/perl -w use strict; use Test::More qw( no_plan ); use File::Remove qw( remove ); use Data::Dumper; my $dir = '{6543}'; ok( -e $dir, $dir." exists" ); my @removed = remove( \1, $dir); print Dumper \@removed; ok(! -e $dir, $dir." removed" ); my $other_dir = '_6543_'; ok( -e $other_dir, $other_dir." exists" ); @removed = remove( \1, $other_dir); print Dumper \@removed; ok(! -e $other_dir, $other_dir." removed"); __END__ ok 1 - {6543} exists $VAR1 = ['6543']; not ok 2 - {6543} removed # Failed test (file_remove_bug.pl at line 12) ok 3 - _6543_ exists $VAR1 = ['_6543_']; ok 4 - _6543_ removed 1..4 # Looks like you failed 1 test of 4 As you can see, the 'curly braced' dir doesn't get removed, but the remove function returns the dir name without the curly braces (in list context, 1 in scalar) I get the same outcome on windows and linux File::Remove v0.38 Windows (ActiveState): v5.8.8 built for MSWin32-x86-multi-thread Linux (suse): v5.8.7 built for x86_64-linux Thanks a lot! Coxy
Bug was caused by globbing of the file names. Resolved the bug by checking for -e $file BEFORE applying globbing. If the path already exists, don't apply globbing to that path. Pending CPAN Testers confirmation, bug fix will appear in File::Remove 1.40.