Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: (OT) cross-platform $HOME

by NetWallah (Canon)
on Feb 23, 2004 at 04:38 UTC ( [id://331027]=note: print w/replies, xml ) Need Help??


in reply to (OT) cross-platform $HOME

On Windows, you could look for $ENV{USERPROFILE}, and store the info in "$ENV{USERPROFILE}\\Application Data\\myapp" - that is a convention many MS apps follow.

The "Application Data" folder is usually hidden, so it already captures the meaning of the leading ".".

Many 3'rd party apps in Windows store data either in the App directory, or a sub-directory. Small quantities of data and config info is stored in the Registry, but you probably don't want to touch that if you are writing a cross-platform app. In your case I'd recommend the "Application Data" directory above.

"Experience is a wonderful thing. It enables you to recognize a mistake when you make it again."

Replies are listed 'Best First'.
Re: Re: (OT) cross-platform $HOME
by BrowserUk (Patriarch) on Feb 23, 2004 at 05:07 UTC

    On XP, you can short-circuit the route to the Application Data directory using $ENV{ APPDATA }, but I'm not sure when (which version) this became available. It wasn't there on NT4, so I think your suggestion is probably better if backwards compatiblity is a concern.


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "Think for yourself!" - Abigail
    Timing (and a little luck) are everything!

      ++BrowserUK. This approach is also better because it supports locales. The application data directory is not always called "Application Data" (e.g. in the German locale it's called "Anwendungsdateien").

      --
      Allolex

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://331027]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2024-04-26 07:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found