I have some perl code which deletes folders using function File::Path::rmtree. This function works successfully if the folder structure contains ascii character files/folders but fails if the folder contains Unicode character files/folders.. Perl version I am using is "This is perl 5, version 12, subversion 4 (v5.12.4) built for MSWin32-x86-multi-thread"
I have also tried using the latest perl version., but the issue persists. Here is sample code:
use strict 'vars';
require File::Path;
sub Rmdir($)
{
my ($Arena) = "D:\\tmp\\TestUnicodeRm";
if (-d $Arena){
print "Dir to Rmtree $Arena\n";
File::Path::rmtree($Arena,0,0);
}
if (-d $Arena){
print "Failed to clean up test area $Arena.\n";
}
}
Rmdir $0;
1;
If the directory 'D:\tmp\TestUnicodeRm' has file with name say 'chinese_trad_我的文件.txt' then I get error as "cannot remove directory for XXX: Directory not empty at D:\tmp\rmtree.pm line XX".
Thanks in advance!