Environment variable for application storage under OSX ?
Jacob Carlborg via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Fri Jul 17 12:00:44 PDT 2015
On 2015-07-17 15:27, anonymous wrote:
> Ok so my sample can be rewritten
>
> ----
> static this() {
> version(Win32) p = environment.get("APPDATA");
> version(linux) p = "/home/" ~ environment.get("USER");
> version(OSX) p = environment.get("HOME") ~ /Library/Application
> Support/;
> }
> ---
Ideally you should hard code the values like this. BTW, why don't you
use the HOME environment variable on Linux.
> I really wish it could be possible to buy and setup OSX on any
> hardware...I will never buy a mac just to test the portability of a
> couple of projects 1 hour per week...
It's possible to run OS X on non-Apple computers, including virtual
machines. But this is not the place to discuss this.
--
/Jacob Carlborg
More information about the Digitalmars-d-learn
mailing list