PerlingTheUK has asked for the wisdom of the Perl Monks concerning the following question:
I am using Tk for an application on Win32 and wanted to use the most windowish looking chooseDirectory dialog to select a directory. This returns a directory of the sort:
In a next step I need to get all xml files in that directory. Which is the point where I struggle.C:/Documents and Settings/UserX/Desktop/WORK/data/var - 21/dat
Globbing for these values returns an arrat that is split at the spaces and terminates before the -:
@files = glob( $path . "/*.xml ); print join ( "\n", @files ); <code> This returns: <code> C:/Documents and Settings/UserX/Desktop/WORK/data/var
I have also tried to alter the path to a Dos standard.
And then globbed without results.$path =~ s/\//\\\\/g; $path =~ s/\ /\\\ /g;
And I also tried to use File::DosGlob.
Both of the last efforts did return an empty array from the glob function. Does anyone know what the bast way to tackle this problem is?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Tk::chooseDirectory and glob problem
by ikegami (Patriarch) on Jun 25, 2005 at 08:00 UTC | |
|
Re: Tk::chooseDirectory and glob problem
by Zaxo (Archbishop) on Jun 25, 2005 at 07:59 UTC | |
by PerlingTheUK (Hermit) on Jun 27, 2005 at 12:04 UTC |