Yes, my experiments were done on Win2K.
Here is the documentation of the "problem" (from the
documentation for the OPENFILENAME structure that is
passed to the GetOpenFileName function):
lpstrInitialDir (a field in that structure)
Pointer to a string that specifies the initial file directory.
Windows NT 5.0 and later; Windows 98 and later:
If lpstrInitalDir is NULL and the current directory contains any files of the specified filter types, the initial directory is the current directory.
If lpstrInitalDir is NULL and the current directory does not contain any files of the specified filter types, the initial directory is the personal files directory of the current user. To specify the current user's personal files directory as the initial directory, set lpstrInitialDir to the path returned by calling theSHGetSpecialFolderLocation function with the CSIDL_PERSONAL flag.
Earlier versions of Windows and Windows NT:
If lpstrInitalDir is NULL, the initial directory is the current directory.
So I was close. The problem isn't with directories named
"tmp", it is with directories that don't contain any files
of the type you requested to be opened.
The documentation implies that if you change this value to
not be NULL, then things will work as you desire. Checking
the source code for Tk (download Tk800_023_tar.gz from CPAN,
extract files, find call to GetOpenFileName in
Tk800.023\pTk\mTk\win\tkWinDialog.c, etc.) I see that
specifying the -initialdir option should take care of
that. Of course, you said that you already tried that. ):
Perhaps you should experiment some more on exactly how you
pass the -initialdir in. I know, for example, that file
dialogues are one of the few places in Win32 that you can't
type forward slash (/) as a directory separator. Perhaps
the -initialdir also requires that only back slashes (\)
be used?
-
tye
(but my friends call me "Tye")
| [reply] |
$file = $w->getOpenFile(-filetypes => \@types,
- initialdir => "c:\\public",);
| [reply] [d/l] |