Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: (OT) cross-platform $HOME

by NetWallah (Abbot)
on Feb 23, 2004 at 04:38 UTC ( #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."


Comment on Re: (OT) cross-platform $HOME
Re: Re: (OT) cross-platform $HOME
by BrowserUk (Pope) 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
Node Status?
node history
Node Type: note [id://331027]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (10)
As of 2014-08-29 15:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (281 votes), past polls