torhu wrote: > Christopher Wright wrote: >> Hey all, >> >> How do I get environment variables in a D program? I specifically want >> the path to a user's home folder. >> >> Ta muchly. > > I think the 'correct' way on Windows is to use SHGetSpecialFolderPathA. > > Something like this: > > char[MAX_PATH] buf; > SHGetSpecialFolderPathA(null, buf.ptr, CSIDL_PERSONAL, false); > char[] dir = toString(buf.ptr); > > or CSIDL_APPDATA, etc.
In tango this is available in tango.sys.win32.SpecialPath -- Lars Ivar Igesund blog at http://larsivi.net DSource, #d.tango & #D: larsivi Dancing the Tango