FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

os.getEnv functionality

 
Post new topic   Reply to topic     Forum Index -> MiniD
View previous topic :: View next topic  
Author Message
the_darkside_986



Joined: 04 Apr 2008
Posts: 10

PostPosted: Thu Apr 10, 2008 3:48 pm    Post subject: os.getEnv functionality Reply with quote

This function does not appear to work properly unless I'm doing something wrong.

I tried doing writefln(os.getEnv("myvar")); which should print the value of the shell variable myvar, but I get null instead. I tried exporting the variable before calling the script, and it still returns null. I tried showing variables in the D programming language by itself (via tango.sys.Environment.get()) and that seems to work as long as I export it first.

I'm using the release of MiniD that is installable via dsss, btw.

It's nothing serious as I can easily write my own native method and bind it to MiniD, but the reason I point it out is because I figured out how to use MiniD as a CGI scripting language on my personal webserver Very Happy But I won't get too far unless I can figure out how to access shell variables.

I hope someday I can make an apache module that can load and execute .md files in a manner similar to php files. But first I have to figure out how to load the D runtime from a C++ program (which always fails when the C++ program is linked to any extra non-standard library Confused )
Back to top
View user's profile Send private message
the_darkside_986



Joined: 04 Apr 2008
Posts: 10

PostPosted: Thu Apr 10, 2008 6:00 pm    Post subject: Reply with quote

Sorry I was mistaken. The problem lies in tango.sys.Environment.

I made my own os.getEnv via tango.stdc.stdlib:getenv. It actually worked. So the problem is with tango not MiniD.
Back to top
View user's profile Send private message
vektorboson



Joined: 14 Sep 2006
Posts: 44

PostPosted: Thu Apr 10, 2008 6:30 pm    Post subject: Reply with quote

Yes; it's an error in Tango's Linux implementation. On Windows a '\0' is appended to the string, on Linux the pointer is passed as is to the getenv-function.

EDIT:
I've submitted a ticket
Back to top
View user's profile Send private message
JarrettBillingsley



Joined: 20 Jun 2006
Posts: 457
Location: Pennsylvania!

PostPosted: Sat Apr 12, 2008 6:07 pm    Post subject: Reply with quote

Woo, got out of that one. Wink
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> MiniD All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group