
miller
User
Apr 28, 2011, 8:05 PM
Post #10 of 10
(2641 views)
|
|
Re: [FishMonger] Need Help With Win32::GetLongPathName
[In reply to]
|
Can't Post
|
|
I created a quick script to make some files with the same names as you provided:
use strict; use warnings; use File::Slurp; while (<DATA>) { chomp; write_file($_, "test"); } __DATA__ .Mylène Farmer & Jean-Louis Murat- Regrets (Razormaid Mix).mp3 Mylène Farmer- Désenchantée (Razormaid Mix).mp3 Mylène Farmer- Je T'Aime Mélancolie (Razormaid Mix).mp3 Mylène Farmer- Psychiatric (121 BPM Razormaid Mix).mp3 Ofra Haza- Ash'alech.mp3 Ofra Haza- Barefoot.mp3 Ofra Haza- I'm Nin' Alu (Razormaid Mix).mp3 Ofra Haza- Kirya.mp3 Ofra Haza- Lefelach Harimon.mp3 Ofra Haza- Ode Le'eli.mp3 OF3552~1.MP3 Ofra Haza- Yachilvi Veyachali.mp3 Ofra Haza- Yesh Li Gan.mp3 -FCDE~1.MP3 I then ran the original script where I outputted to a file instead of to the console:
#!/usr/bin/perl use warnings; use strict; use File::Find; use Win32; my $dir = shift || '.'; open my $fh, '>', 'files.txt' or die $!; select $fh; find(sub { print $_, "\t", Win32::GetShortPathName($_), "\n"; }, $dir); And everything appears to work fine. Note, I don't have any utf8 characters in my files, just extended ascii. But that much works at least. - Miller
|