Better late than never...
On Sunday, 23 November 2008 at 02:28:30 UTC, Christopher Wright
wrote:
...
I thought (perhaps wrongly) C allowed you to declare main as
taking a list of environment variables, which is why I asked
Indeed, on Unix { not POSIX } and Windows:
From Wiki:
On Mon, 24 Nov 2008 16:53:20 +0300, Christopher Wright
<[EMAIL PROTECTED]> wrote:
John C wrote:
novice2 Wrote:
i am afraid that windows API named *W works with UCS2 string.
but D wchar[] is UTF-16.
Wrong - Windows has used UTF-16 as native since Windows 2000.
Actually, you're both right
John C wrote:
novice2 Wrote:
i am afraid that windows API named *W works with UCS2 string.
but D wchar[] is UTF-16.
Wrong - Windows has used UTF-16 as native since Windows 2000.
Actually, you're both right. UCS2 is UTF-16.
novice2 Wrote:
> i am afraid that windows API named *W works with UCS2 string.
> but D wchar[] is UTF-16.
Wrong - Windows has used UTF-16 as native since Windows 2000.
> Under what setups can the drive letter be a non-ASCII character?
any non-english windows have folders, usernames, etc with non-ascii chars,
therefore this names presents in environment, registry, file API etc.
> wchar[] wpath;
> wpath.length = GetEnvironmentVariableW("HOMEPATH", null, 0
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
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(n
"novice2" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
homeDrive = toString(getenv("HOMEDRIVE")).dup;
homePath = toString(getenv("HOMEPATH")).dup;
don't forget, that D char[] is utf8 and windows char* is 8-bit chars, not
utf8.
so you should import std.windows.charset and
> homeDrive = toString(getenv("HOMEDRIVE")).dup;
> homePath = toString(getenv("HOMEPATH")).dup;
don't forget, that D char[] is utf8 and windows char* is 8-bit chars, not utf8.
so you should import std.windows.charset and use toMBSz() as D->WindowsAPI and
fromMBSz as WindowsAPI->D string c
Reply to Christopher,
I thought (perhaps wrongly) C allowed you to declare main as taking a
list of environment variables,
It does.
Jarrett Billingsley wrote:
On Sat, Nov 22, 2008 at 12:55 PM, Christopher Wright <[EMAIL PROTECTED]> 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.
In Tango, there's tango.sys.Environment
(http://www.dsource
"Christopher Wright" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hey all,
How do I get environment variables in a D program?
std.c.stdlib.getenv
http://www.cplusplus.com/reference/clibrary/cstdlib/getenv.html
I specifically want the path to a user's home folder.
Platform-de
On Sat, Nov 22, 2008 at 12:55 PM, Christopher Wright <[EMAIL PROTECTED]> 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.
>
In Tango, there's tango.sys.Environment
(http://www.dsource.org/projects/tango/
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.
14 matches
Mail list logo