Changeset 23464 for test-collections


Ignore:
Timestamp:
2010-12-13T16:12:56+13:00 (13 years ago)
Author:
davidb
Message:

Further debugging output for working with Windows files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test-collections/trunk/filename-encodings/bin/script/dirlist.pl

    r23346 r23464  
    11#!/usr/bin/perl -w
    22
    3 use strict;
    43
     4use Encode;
    55
    66sub debug_unicode_string
     
    3131close(DIN);
    3232
    33 #open(FOUT,">file-list.txt")
    34 #    || die "Unable to open file-list.txt";
    35 
    3633foreach my $f (@files)
    3734{
     
    4138    my $dirsep = ($^O =~ /mswin/i) ? "\\" : "/";
    4239
    43     # Remove trailing directory separator
    44     # (will be explicitly added in later on)
    4540    $f =~ s@$dirsep$@@;
    4641
    47     if ( -e "$dir$dirsep$f" ) {
    48     print "   Perl can see file $dir$dirsep$f\n";
     42    my $full_f = "$dir$dirsep$f";
     43    if ($^O =~ /mswin/i) {
     44    require Win32;
     45    $full_f = Win32::GetLongPathName($full_f);
     46    #$full_f = encode("UTF8",$full_f);
     47    print "Windows full filename:       ", $full_f,"\n";
     48    print "Windows full filename debug: ", debug_unicode_string($full_f),"\n";
     49
     50    $full_f = Win32::GetShortPathName($full_f);
     51    }
     52
     53    if ( -e $full_f ) {
     54    print "   Perl can see file $full_f\n";
    4955    }
    5056    else {
    51     print "   Perl CANNOT see $dir$dirsep$f\n";
     57    print "   Perl CANNOT see $full_f\n";
    5258    }
    53 #    print FOUT "$f\n";
    5459}
    5560
    56 #close(FOUT);
     61
Note: See TracChangeset for help on using the changeset viewer.