in reply to Re^2: Installing a config file during module operation
in thread Installing a config file during module operation

I did cast a look at that module, but since it uses the return value of Win32::GetFolderPath(CSIDL_LOCAL_APPDATA) to find a good place to store the config files and Win32::GetFolderPath(CSIDL_LOCAL_APPDATA) on my Windows XP Professional points to C:\Documents and Settings\kjm\Desktop, all the config files would be put on my desktop!

Obviously that is not a good solution. Perhaps there is something wrong in my setup, but if the module relies on something which can be so easily broken, I rather pass.

Update: I checked the module once more and the latest version (0.18 or 0.21) does import the constant, so it seems OK.

CountZero

"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

Replies are listed 'Best First'.
Re^4: Installing a config file during module operation
by Tanktalus (Canon) on Aug 08, 2005 at 04:23 UTC

    I'm getting the same idea on the windows machine here, too - wierd. According to the CSIDL documentation on MS's site, CSIDL_LOCAL_APPDATA has "[a] typical path [of] C:\Documents and Settings\username\Local Settings\Application Data." [emphasis in original] But here, that returns the desktop, just like yours. Wierd. Perhaps that's a bug in Win32?

    Update: No, no bug in Win32 - nor even Windows. PEBKAC. As xdg points out, failing to import the constant was the problem. That said, it was quite well hidden at the end of a longish paragraph. I suppose I could make a suggestion to the author: bold this in the perldoc :-) - but that's merely a suggestion, not a bug report ;-)

      hey, bug reports are welcome!!!

      Where do you thing the configuration files should go? what version of windows are you using?

      update: btw, on my windows xp it points to

      C:\Documents and Settings\salva\Local Settings\Application Data\

      anyway, I have uploaded a new version to CPAN with a work around that will ignore LOCAL_APPDATA or APPDATA when they point to any place below the user desktop.

        I suspect people aren't reading docs for Win32. You have to import the constant. (I'll admit I didn't do that at first, either.)

        > perl -MWin32 -le "print Win32::GetFolderPath(CSIDL_LOCAL_APPDATA)" C:\Documents and Settings\DGolden\Desktop > perl -MWin32=CSIDL_LOCAL_APPDATA -le "print Win32::GetFolderPath(CSI +DL_LOCAL_APPDATA)" C:\Documents and Settings\DGolden\Local Settings\Application Data

        -xdg

        Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.