in reply to Re^3: renaming filenames
in thread renaming filenames
1. Active Perl or Strawberry Perl ?
2. What shows your $_ in your program ? With my XP, it shows 8.3 style file names(For example, "Program Files"=> Progra~1).
What would $_ with Windows 7?.foreach (@files) { print "$_\n"; my $original = $_; s/canción/poesía/; rename "$directory\\$original", "$directory\\$_"; }
3. When you install Win32::Unicode,Win32::Unicode::Dir, Does this work ?
I tried with ActivePerl. As "andalou" says, I also met the same error when calling moveW. It seems lacking XS's function which is calling Win32API. I guess Strawberry Perl works ... fine?use strict; use warnings; use utf8; use Win32::Unicode; use Win32::Unicode::Dir; my $wdir = Win32::Unicode::Dir->new; $wdir->open('./'); while ( my $file=$wdir->fetch ) { next if( $file !~ /^canción/ ); my $file_new=$file; $file_new =~ s/canción/poesía/; printW "$file ==> $file_new\n"; #moveW($file, $file_new) or die $!; } $wdir->close;
Update:
I understand OP="andalou" now. If you are using Active Perl,
will remove your Win32::Unicode error messages. </code>ppm install "http://sourceforge.jp/frs/g_redir.php?m=jaist&f=%2Fassp%2 +FASSP+V2+multithreading%2Fpackages%2FWin32-Unicode.ppd"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: renaming filenames
by andalou (Novice) on Aug 21, 2012 at 22:44 UTC | |
by remiah (Hermit) on Aug 22, 2012 at 05:24 UTC |