Environment variable for application storage under OSX ?

2015-07-16 Thread anonymous via Digitalmars-d-learn
I have the following code, working under Win and Linux: --- import std.process: environment; immutable string p; static this() { version(Win32) p = environment.get("APPDATA"); version(linux) p = "/home/" ~ environment.get("USER"); version(OSX) p = "?"; } --- what would be the OSX e

Re: Environment variable for application storage under OSX ?

2015-07-16 Thread byron via Digitalmars-d-learn
On Thursday, 16 July 2015 at 21:12:05 UTC, anonymous wrote: I have the following code, working under Win and Linux: --- import std.process: environment; immutable string p; static this() { version(Win32) p = environment.get("APPDATA"); version(linux) p = "/home/" ~ environment.get("USE

Re: Environment variable for application storage under OSX ?

2015-07-16 Thread Maeriden via Digitalmars-d-learn
On Thursday, 16 July 2015 at 21:12:05 UTC, anonymous wrote: I have the following code, working under Win and Linux: --- import std.process: environment; immutable string p; static this() { version(Win32) p = environment.get("APPDATA"); version(linux) p = "/home/" ~ environment.get("USE

Re: Environment variable for application storage under OSX ?

2015-07-17 Thread FreeSlave via Digitalmars-d-learn
On Thursday, 16 July 2015 at 21:12:05 UTC, anonymous wrote: I have the following code, working under Win and Linux: --- import std.process: environment; immutable string p; static this() { version(Win32) p = environment.get("APPDATA"); version(linux) p = "/home/" ~ environment.get("USE

Re: Environment variable for application storage under OSX ?

2015-07-17 Thread Anonymous via Digitalmars-d-learn
On Friday, 17 July 2015 at 07:14:24 UTC, FreeSlave wrote: On Thursday, 16 July 2015 at 21:12:05 UTC, anonymous wrote: I have the following code, working under Win and Linux: --- import std.process: environment; immutable string p; static this() { version(Win32) p = environment.get("APPDAT

Re: Environment variable for application storage under OSX ?

2015-07-17 Thread FreeSlave via Digitalmars-d-learn
On Friday, 17 July 2015 at 07:33:43 UTC, Anonymous wrote: On Friday, 17 July 2015 at 07:14:24 UTC, FreeSlave wrote: On Thursday, 16 July 2015 at 21:12:05 UTC, anonymous wrote: I have the following code, working under Win and Linux: --- import std.process: environment; immutable string p; sta

Re: Environment variable for application storage under OSX ?

2015-07-17 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-07-17 09:33, Anonymous wrote: So for a software named 'SuperDownloader2015' it would be $HOME/Library/Application Support/SuperDownloader2015 right ? so it's not user-specific and it's writable for the current user ? sorry but it looks a bit strange, anyone can confirm ? Yes, that'

Re: Environment variable for application storage under OSX ?

2015-07-17 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-07-16 23:12, anonymous wrote: I have the following code, working under Win and Linux: --- import std.process: environment; immutable string p; static this() { version(Win32) p = environment.get("APPDATA"); version(linux) p = "/home/" ~ environment.get("USER"); version(OS

Re: Environment variable for application storage under OSX ?

2015-07-17 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-07-17 09:14, FreeSlave wrote: Hello. You may take a look at this library https://github.com/MyLittleRobo/standardpaths OSX version uses Carbon though. You may want to use Cocoa API (which is newer), but it's Objective-C. DMD master now has some initial support for Objective-C. -- /Jac

Re: Environment variable for application storage under OSX ?

2015-07-17 Thread anonymous via Digitalmars-d-learn
On Friday, 17 July 2015 at 07:54:43 UTC, FreeSlave wrote: On Friday, 17 July 2015 at 07:33:43 UTC, Anonymous wrote: On Friday, 17 July 2015 at 07:14:24 UTC, FreeSlave wrote: On Thursday, 16 July 2015 at 21:12:05 UTC, anonymous wrote: I have the following code, working under Win and Linux: ---

Re: Environment variable for application storage under OSX ?

2015-07-17 Thread Jacob Carlborg via Digitalmars-d-learn
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/; } --- I