D - environment variable
- manfred toppoint.de (11/11) Sep 02 2003 Hello,
 - Charles Sanders (7/18) Sep 02 2003 If this is windows, you can use DIG's
 - Helmut Leitner (22/51) Sep 02 2003 It seems that Burton has only put a thin wrapping over standard Phobos
 
Hello,
how can i get the environment variable's in D.
In c i can do this: 
int main(int argc, char* argv[],char* envp[]) {
int i = 0;
while (envp[i]!=NULL) {
printf("\n");
printf(envp[i++]);
}
return 0;
}
 Sep 02 2003
If this is windows, you can use DIG's
Control.OS.environmentalVariable(char [] name)
http://www.opend.org/dig/classControl_1_1OS.html
But only if you know the env variable name.
Charles
<manfred toppoint.de> wrote in message
news:bj27g4$28a4$1 digitaldaemon.com...
 Hello,
 how can i get the environment variable's in D.
 In c i can do this:
 int main(int argc, char* argv[],char* envp[]) {
 int i = 0;
 while (envp[i]!=NULL) {
 printf("\n");
 printf(envp[i++]);
 }
 return 0;
 }
 Sep 02 2003
Charles Sanders wrote:If this is windows, you can use DIG's Control.OS.environmentalVariable(char [] name) http://www.opend.org/dig/classControl_1_1OS.html But only if you know the env variable name. Charles <manfred toppoint.de> wrote in message news:bj27g4$28a4$1 digitaldaemon.com...It seems that Burton has only put a thin wrapping over standard Phobos functions: /* from stdlib.d */ extern (C) char *getenv(char *varname); extern (C) int putenv(char *envstring); /* from net\BurtonRadons\dig\windows\windows.d */ /** Return an environment variable or null if this is not assigned. */ static char [] environmentVariable (char [] name) { return string.toString (getenv (toStringz (name))).dup; } /** Assign an environment variable. */ static void environmentVariable (char [] name, char [] value) { putenv (toStringz (name ~ "=" ~ value)); } -- Helmut Leitner leitner hls.via.at Graz, Austria www.hls-software.comHello, how can i get the environment variable's in D. In c i can do this: int main(int argc, char* argv[],char* envp[]) { int i = 0; while (envp[i]!=NULL) { printf("\n"); printf(envp[i++]); } return 0; }
 Sep 02 2003








 
 
 
 Helmut Leitner <helmut.leitner chello.at>