in reply to Escape blank spaces

An end-around for handling "wacky" filename issues on Win32 is to resort to:

use Win32; use strict; my $filename_w_spaces = 'this err.txt'; # the file has to exist to play this game.... if ( -e $filename_w_spaces ) { print "$filename_w_spaces\n"; my $short_filename_wo_spaces = Win32::GetShortPathName($filename_w_spaces); print "$short_filename_wo_spaces\n"; my $long_filename_w_spaces = Win32::GetLongPathName($short_filename_wo_spaces); print "$long_filename_w_spaces\n"; }

Replies are listed 'Best First'.
Re^2: Escape blank spaces
by ysth (Canon) on Jun 19, 2007 at 02:17 UTC
    It's my understanding that generation of short names can be turned off, so it's not good to count on them.
      Is that an option the Win32 user sets such that programs coming along that use short names get stymied?
        I believe so.